TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Harish Batchu
NA
255
69.9k
When Parsing the data into pie chart i am getting last row?
Nov 2 2018 1:03 PM
I am reading the data from database and ploat into piechart. But i have an issue when ploating the data into the pie chart. I am getting only last value. I don't know how to do it.
I am put code below.
function OnSuccess(response) {
// var table = $("#dvCustomers table").eq(0).clone(true);
console.log(response);
var customers = response.d;
var arr = [];
var arr1 = [];
var inval = "";
var ic = "";
var data = {};
var i = 0;
//var fruits = new Array();
$(customers).each(function () {
data['value'] = this.IncomeAmount;
data['name']= this.IncomeType;
i++;
ic += "'" + getRandomColor() + "',";
});
When return sucess am put database code into data array here each time new value is assign the new when loop ends the last value only place in their.
series: [
{
name: 'Month Income',
type: 'pie',
radius: '80%',
center: ['50%', '50%'],
roseType: 'radius',
color: [ic],
label: {
normal: {
fontFamily: 'Poppins, sans-serif',
fontSize: 12
}
},
data: [
data
].sort(function (a, b) { return a.value - b.value; }),
In above code the data variable have only last value i need all rows of data. i am getting only last row of data
please fix it...
Reply
Answers (
4
)
create a new web api by using another app web api.
After click on Add to product list button , the another page