Hi
Need help with data insertion into google charts.
Taken this from documentation example.
var data = google.visualization.arrayToDataTable([
> ['Age', 'Weight'],
> [ 8, 12],
> [ 4, 5.5],
> [ 11, 14]
> ]);
>
when i replace this with array
var data = google.visualization.arrayToDataTable([
> ['Age', 'Weight'],
> [eval(arr1[0]),eval(arr2[0])]
> [eval(arr1[1]),eval(arr2[1])]
> [eval(arr1[2]),eval(arr2[2])]
>
> ]);
it still works. But when i replace it with a for loop:
var data = google.visualization.arrayToDataTable([
>> ['Age', 'Weight'],
>> for(var i=0;i<arr1.length;i++) {
>> [eval(arr1[i]),eval(arr2[i])],
>> }
>>
>> ]);
>>
>
I get a syntax error message in javascript error console pointing at the
start of the 'for' loop.
What am i doing wrong ?
Any help is greatly appreciated. Thanks a lot !
--
You received this message because you are subscribed to the Google Groups
"Google Chart API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-chart-api/-/lyb8Mkku7Q4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-chart-api?hl=en.