Most likely, the value pulled from the HTML element is being interpreted as
a string. You might be able to get it to work by using eval() on the input
before passing it to the #arrayToDataTable method:
var data = google.visualization.arrayToDataTable(eval(T));
On Thursday, June 7, 2012 7:16:00 AM UTC-4, visigoth wrote:
>
> I'm not sure what the source of the problem is (if you send me a simple
> example page I will debug it), but have you tried using setRows() instead?
> That is:
> var data = new google.visualization.DataTable();
> data.setColumn(...);
> ...
> data.setRows(hiddenFieldData);
>
> On Wednesday, June 6, 2012 8:58:43 AM UTC+3, Lucky wrote:
>>
>> As I am new to Use Google Chart API,
>> How can we bind the values which I receive from the data source to a
>> datatable to Google.Visualization.Datatable()
>>
>> Suppose I had some values in Hidden field
>> Like
>> ['Task','Hours per Day'],
>> ['Mushrooms', 3],
>> ['Onions', 3],
>> ['Olives', 1],
>> ['Zucchini', 1],
>> ['Pepperoni', 2]
>>
>> Now i want to bind these values to
>> var data2 = google.visualization.arrayToDataTable([]);
>>
>> It works fine for below when I specify the values like this
>> var data2 = google.visualization.arrayToDataTable([
>> ['Country', 'Population', 'Area'],
>> ['CN', 1324, 9640821],
>> ['IN', 1133, 3287263],
>> ['US', 304, 9629091],
>> ['ID', 232, 1904569],
>> ['BR', 187, 8514877]
>> ]);
>>
>> how can I bind these values to google.visualization.arrayToDataTable()
>> I had tried
>> var T =$("#hidChartData").val();
>>
>> var data = google.visualization.arrayToDataTable(T) does not
>> support .
>>
>> or
>>
>> var data = google.visualization.DataTable(T) also does not
>> support
>>
>> Please help me out .
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/v229ZnUdrvAJ.
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-visualization-api?hl=en.