Your dates are not input correctly. The correct way to input dates in the Viz API's JSON format is a string in the format "Date(year, month, day[, hour[, minute[, second[, microsecond]]]])", where month is zero-indexed (so January is 0 not 1). Assuming your dates are in the format "year-month-day", you would input "2013-06-01" as "Date(2013, 5, 1)".
On Saturday, June 1, 2013 4:23:01 PM UTC-4, Martin Pieters wrote: > > <html> <head> <script type="text/javascript" > src="https://www.google.com/jsapi"></script> <script > type="text/javascript"> google.load("visualization", "1", > {packages:["corechart"]}); google.setOnLoadCallback(drawChart); > function drawChart() { var jsonData = $.ajax({ url: > "getData.php", dataType:"json", async: false > }).responseText; var data = new > google.visualization.DataTable(jsonData); var options = { > title: 'Actuele watertemperatuur Domelaar' }; var chart = new > google.visualization.LineChart(document.getElementById('chart_div')); > chart.draw(data, options); } </script> </head> <body> <div > id="chart_div" style="width: 900px; height: 500px;"></div> </body></html> > > Output of getData.php is > {"cols":[{"label":"Date","type":"date"},{"label":"Temp","type":"double"}],"rows":[{"c":[{"v":"2013-06-01"},{"v":14}]},{"c":[{"v":"2013-06-02"},{"v":14}]},{"c":[{"v":"2013-06-03"},{"v":14}]},{"c":[{"v":"2013-06-04"},{"v":14}]},{"c":[{"v":"2013-06-05"},{"v":14}]},{"c":[{"v":"2013-06-08"},{"v":15}]},{"c":[{"v":"2013-06-06"},{"v":15}]},{"c":[{"v":"2013-06-09"},{"v":15}]},{"c":[{"v":"2013-06-07"},{"v":15}]}]} > > -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
