I want to create a graph (AnnotatedTimeLine ) from this spreadsheet:
https://spreadsheets.google.com/ccc?key=0AhgU7I4IfehhdHFaZGRlZzMxWFNXejhzdUN6dDhpQVE
The problem is that the first column, A, containg the dates is
retrieved as string not as date time, as AnnotatedTimeLine expects
Firebug reports this: First column must contain date, or date and
time.
I formatted the column as date time using the 123 drop down menu.
from the HTML source:
function drawVisualization() {
// To see the data that this visualization uses, browse to
//
http://spreadsheets.google.
com/ccc?key=pCQbetd-CptGXxxQIG7VFIQ
var query = new google.visualization.Query(
'
http://spreadsheets.google.com/tq?
key=0AhgU7I4IfehhdHFaZGRlZzMxWFNXejhzdUN6dDhpQVE');
// Apply query language.
query.setQuery('SELECT A,B,C');
// Send the query with a callback function.
query.send(handleQueryResponse);
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
return;
}
var data = response.getDataTable();
var annotatedtimeline = new
google.visualization.AnnotatedTimeLine(document.getElementById('visualization'));
annotatedtimeline.draw(data, {'displayAnnotations':
true});
}
Thank you