问题
I have a working Google Annotated Timeline (see docs at http://code.google.com/apis/chart/interactive/docs/gallery/annotatedtimeline.html).
I would like to explicitly set a start_date and end_date, I presume by using zoomStartTime
and zoomEndTime
. But, I cannot get it to work and I think it's either because my syntax is wrong or because I'm using the wrong format for dates.
My last line of the function:
chart.draw(data, {'displayAnnotations': true}, {'zoomStartTime': new Date(2011, 6, 26)}, {'zoomEndTime': new Date(2011,6,30)});
How can I correct this?
回答1:
You should merge the options in a single hash:
chart.draw(data, {'displayAnnotations': true,
'zoomStartTime': new Date(2011, 6, 26),
'zoomEndTime': new Date(2011,6,30)
}
);
来源:https://stackoverflow.com/questions/6483801/configuring-google-annotated-timeline