Your JSON isn't in the right format for the Visualization API, so you would either need to change the JSON format or manually build a DataTable using the data in your JSON. Either way, you need to have a DataTable object to draw the charts with. Here's a quick-and-dirty conversion for you: http://jsfiddle.net/asgallant/2MxnR/
Note that the chart looks weird because your data isn't in chronological order, to fix that you can sort the DataTable after building it: http://jsfiddle.net/asgallant/2MxnR/1/ On Friday, November 16, 2012 11:47:55 AM UTC-5, jdv590 wrote: > > I am trying to fill a line chart with JSON data via ajax from an asp.netweb > service. When I run my code I get an error saying: > > Object {"it then lists all my JSON formatted data"} has no method >> 'getColumnType'. > > > > I have attached a snapshot of the error message, as well as a text file > with the JSON data. My code is below: > > <script type='text/javascript' src='https://www.google.com/jsapi >> '></script> >> <script type="text/javascript"> >> >> google.load("visualization", "1", { packages: ["corechart"] >> }); >> google.setOnLoadCallback(drawChart); >> // $(document).ready(function () { >> function drawChart() { >> var jsonData = $.ajax({ >> url: "WebService.asmx/HelloWorld", >> data: "{}", >> contentType: "application/json; charset=utf-8", >> dataType: "json", >> async: false >> }).responseText; >> var options = { >> title: 'Company Performance' >> }; >> var chart = new >> google.visualization.LineChart(document.getElementById('chart_div1')); >> chart.draw(jsonData, options); >> } >> >> //}); >> >> </script> > > -- 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/-/pgyVVpDFE8oJ. 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.
