devel...@nctcog.org
unread,Jun 18, 2012, 12:00:28 PM6/18/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Visualization API
Is it possible to have a variable array of points in a line or bar
chart?
Your code example shows
var data = new google.visualization.arrayToDataTable ([
['heading1','heading2'],
[data point, datapoint],
[data point, datapoint]
]);
All of the points are hard coded, but I don't know how many points I'm
going to have. It could be any where from 0-96.
I have successfully passed in arrays so it reads as
['heading1', 'heading2'],
[arr1[0],arr2[0]],
[arr1[1],arr2[1]]
]);
and so forth but I'm having to build ridiculously large case
statements to handle the arrays so i don't get errors.
I tried building in a for next loop for the array elements, but I'm
getting syntax errors on that as well.
Here is my code with the loop that is giving syntax errors:
var data = new google.visualization.arrayToDataTable([
['Time','Count'],
for (var n=0;n<96;n++)
{
[arr2[n], parseInt(arr[n]) ],
}
[arr2(mycount),parseInt(arr[mycount])]
]);