Configuring Google Annotated Timeline

久未见 提交于 2019-12-25 03:59:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!