When i use this (valid) XML :

{"cols":[{"id":"task", "type":"string"},{"id":"val", "type":"number"}],
"rows": [{"task":"Work", "val":"1"},{"task":"study", "val":"5"},{"task":
"eat", "val":"3"},{"task":"nap", "val":"1"}]}


i get client side error:  "Cannot read property '1' of undefined".

I thought maybe it is the quotes.. but i get the same above error when i 
try: 

{"cols":[{"id":"task", "type":"string"},{"id":"val", "type":"number"}],
"rows": [{"task":"Work", "val":1}]}




My mainline processing code is:

    google.load('visualization', '1', {'packages':['corechart']});
    // Set a callback to run when the Google Visualization API is loaded.
    google.setOnLoadCallback(drawChart);
    function drawChart() {
      var jsonData = $.ajax({
          url: "getjson.jsp",
          dataType:"json",
          async: false,
          legend:{position: 'labeled'}
          }).responseText;
          
      // Create our data table out of JSON data loaded from server.
      var data = new google.visualization.DataTable(jsonData);

      // Instantiate and draw our chart, passing in some options.
      var chart = new 
google.visualization.Histogram(document.getElementById('chart_div'));
      chart.draw(data, {width: 400, height: 240});
    }
    </script>



On Thursday, April 30, 2015 at 4:53:40 PM UTC-4, Ben Falchuk wrote:
>
> Does anyone have the JSON data that would have to be sent back to the 
> client (ajax) in order to generate the histogram chart found in the example:
>
> https://developers.google.com/chart/interactive/docs/gallery/histogram
>
> ..while still using arrayToDataTable as in the example? 
>
> thanks,
> ben.
>

-- 
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