I would like to create a timeline chart with google charts (although I think the type of chart is irrelevant).
I have the data in a google spreadsheet and it contains a column of strings and two columns of dates. When I try it I get the error message: > Invalid data at row #2: start(Wed Jan 21 2015 00:00:00 GMT+0200 (EET)) > end(Tue Jan 14 2014 00:00:00 GMT+0200 (EET)) When I put a console.dir on one of the date values in the dataTable that is constructed from the data in the spreadsheet I get. > Tue Jan 14 2014 00:00:00 GMT+0200 (EET) __proto__: Invalid Date ... I am using a URL like this to query for the data on the spreadsheet > https://docs.google.com/spreadsheets/d/[key]/edit?usp=sharing&sheet=4-Visiens&range=A1:C53&headers=1 I'm guessing that when the code queries the spreadsheet the date is converted into a string which then can't be parsed by the visualization library. Am I missing something or do I have to create a second column for each date column that converts that date column into a string that the google visualization can handle? The strange thing is if the column isn't a date, number of dateTime format then it shows > Invalid data table format: column #1 must be of type 'date,number,datetime'. Code below. <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["timeline"]}); google.setOnLoadCallback(drawChart); function drawChart() { var query = new google.visualization.Query( 'https://docs.google.com/spreadsheets/d/[key]/edit?usp=sharing&sheet=4-Visiens&range=A1:C53&headers=1'); query.send(handleQueryResponse); } function handleQueryResponse(response) { if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; } var container = document.getElementById('timeline'); var chart = new google.visualization.Timeline(container); var dataTable = response.getDataTable(); console.dir(dataTable.getValue(2, 2)); chart.draw(dataTable); } </script> </head> <body> <div id="timeline" style="width: 900px; height: 180px;"></div> </body> </html> -- 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.