Page 2 of 2

graph a pie chart using variable names (jqplot)

Posted: Wed Dec 18, 2013 2:22 am
by Alex GG

hello Igor.
the link you gave me, doesn ́t help me at all. I ́d try to explain again:
this is my data mapping using DB of above:
Image
I use "where" in the request with this : return '{"servicio":"bb"}';
and in the result page I get these two values (cantidad) in labels: Image

what I need is a JS to get the total of those values. let say 600+400 = 1000.
thanks!!


graph a pie chart using variable names (jqplot)

Posted: Wed Dec 18, 2013 7:42 am
by Maryna Brodina

Hello! You can calculate sum of elements on service Success event: prevar sum = 0;
data.forEach(function(el){ sum+= +el['cantidad']});
alert(sum);/pre


graph a pie chart using variable names (jqplot)

Posted: Wed Dec 18, 2013 7:43 pm
by Alex GG

great!!! thanks Maryna =)