Hi, I've been working on a script to query data, return it in JSON format, and then plot the data in a annotated timeline, but when trying to put the JSON formatted data into a Google DataTable, I get the error my browsers console: Uncaught TypeError: Object 09/12/2010 has no method 'getTime'
My JSON data looks like:
{"cols":[{"label":"dated","type":"date"},{"label":"price","type":"number"}],"rows":[{"c":[{"v":"09\/12\/2010"},{"v":0.93}]},{"c":[{"v":"10\/12\/2010"},{"v":0.83}]},{"c":[{"v":"13\/12\/2010"},{"v":0.84}]},{"c":[{"v":"14\/12\/2010"},{"v":0.84}]},{"c":[{"v":"15\/12\/2010"},{"v":0.79}]},{"c":[{"v":"16\/12\/2010"},{"v":0.79}]},{"c":[{"v":"17\/12\/2010"},{"v":0.82}]},{"c":[{"v":"20\/12\/2010"},{"v":0.79}]},{"c":[{"v":"21\/12\/2010"},{"v":0.83}]},{"c":[{"v":"23\/12\/2010"},{"v":0.82}]},{"c":[{"v":"27\/12\/2010"},{"v":0.82}]},{"c":[{"v":"28\/12\/2010"},{"v":0.84}]},{"c":[{"v":"29\/12\/2010"},{"v":0.94}]},{"c":[{"v":"30\/12\/2010"},{"v":0.87}]},{"c":[{"v":"31\/12\/2010"},{"v":0.89}]},{"c":[{"v":"03\/12\/2011"},{"v":0.86}]},{"c":[{"v":"04\/12\/2011"},{"v":0.87}]},{"c":[{"v":"05\/12\/2011"},{"v":0.85}]},{"c":[{"v":"06\/12\/2011"},{"v":0.85}]}]}
I have attached the php file that queries the data, and here is the
javascript snippet that calls it. The error comes from the line: var data =
new google.visualization.DataTable(JSON.parse(jsonData));
var jsonData = $.ajax({
url: "http://localhost/test/Querymydata.php",
dataType:"json",
crossDomain : true,
async: false
}).responseText;
var data = new google.visualization.DataTable(JSON.parse(jsonData));
Thanks for any help solving this.
--
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/groups/opt_out.
<<attachment: Querymydata.php>>
