On Apr 9, 4:46 pm, VizGuy <[email protected]> wrote:
> This is of course not an Annotated time line issue, but a general problem of
> converting SQL dates into js dates.Once you succeed to create a data table,
> with a valid date or datetime column, and a valid js Date object in the
> value, you should be good.
...
To save some trouble, here's is a code snippet:
/**
* converts "m/d/Y hh:mm" into a Date object
*/
function convertDate(datetime) {
var tmp=datetime.split(' ');
var dt=tmp[0].split('/');
var t=tmp[1].split(':');
var d = new Date;
d.setFullYear(dt[2],(dt[0]-1),dt[1]);
d.setHours(t[0],t[1],0,0);
return d;
}
Also, I think the API for the Annotated Time Line gadget changed
recently. The time display on top of the graph began to only show the
"Date" and not "Time+Date". Turns out, now you have to specify the
DateFormat as an option when calling the draw method.
chart.draw(data, {displayAnnotations: true,dateFormat: 'HH:mm MMMM dd,
yyyy'});
~Rolan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
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
-~----------~----~----~----~------~----~------~--~---