If you are getting that error message, it means you are either loading the 
API incorrectly, or you aren't waiting for it to load before trying to use 
API components.  It would help me to diagnose your issue if you could post 
a complete example that demonstrates the problem.

When you have that fixed, you need to remove the "new" keyword from the 
arrayToDataTable call:

var data = google.visualization.arrayToDataTable(dataArray);


On Thursday, June 26, 2014 10:12:34 AM UTC-4, Nagendra Singh wrote:
>
> When I am hitting the url I am getting data in this form
>
> {"1":{"id":0,"bufferCount":24,"cpu":97.2,"memory":64.21965762722566,"siteName":null,"siteIndicatorColor":0,"dateOfOccurence":1402079370000}}
>
>
>
> Please suggest how can I map this to Column chart. I have tried using 
> dataArray but an error- cannot read property 'arrayToDatatable' of undefined 
> occurs... 
>
>
>  var jsonObj = JSON.parse(jsonData);
>         // Create our data table out of JSON data loaded from server.
>         var size = 0;
>         for(var sizeCount in jsonObj){
>             size++;
>         }
>         var dataArray = new Array(size+1);
>         dataArray[0] = new Array(2);
>         dataArray[0][0] = 'bufferCount';
>         dataArray[0][1] = 'cpu';
>         dataArray[0][2] = 'memory';
>         
>         dataArray[0][3] = 'dateOfOccurence';
>         
>         //dataArray[0][2] = {type:'string', role:'tooltip'};
>         var i = 1;
>
>     while(i < size+1){
>             dataArray[i] = new Array(2);
>             dataArray[i][0] = (jsonObj[i].bufferCount);
>             dataArray[i][1] = (jsonObj[i].cpu);
>             dataArray[i][2] = (jsonObj[i].memory);
>             dataArray[i][3] =new Date(jsonObj[i].dateOfOccurence);
>             //dataArray[i][2] = (jsonObj[i].bufferCount);
>             i++;
>         }
>
>     var data = new google.visualization.arrayToDataTable(dataArray);
>
>

-- 
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to