Hi ,
I have a java script array with which i am trying to create a pie chart,
var a=['Monday','Tuesday','Wednesday'];
var b=[3,5,9];
Now when i use the following code to initialize the data table , the chart
is created
var data =
google.visualization.arrayToDataTable([['Day','Hours'],[a[0],b[0]],[a[1],b[1]],[a[2],b[2]]);
I want to initialize the data table using a for loop with something like
this,
for(var i=0;i<a.length;i++)
{
var data =
google.visualization.arrayToDataTable([['Day','Hours'],[a[i],b[i]]]);
}
But this will just print the chart for the last value of the array.
Can you please help me?
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/3c4722fc-dbfe-40cc-9019-3562b114de2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.