配置Google注释时间线 [英] Configuring Google Annotated Timeline

查看:151
本文介绍了配置Google注释时间线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有效的Google注释时间表(请参阅 http ://code.google.com/apis/chart/interactive/docs/gallery/annotatedtimeline.html )。



我想明确地设置一个start_date和end_date,我推测使用 zoomStartTime zoomEndTime 。但是,我无法实现它,我认为这是因为我的语法错误,或者因为日期格式错误。



我的最后一行是函数:

$ p $ chart.draw(data,{'displayAnnotations':true},{'zoomStartTime':new Date(2011, 6,26)},{'zoomEndTime':new Date(2011,6,30)});

我该如何解决这个问题?

解决方案

您应该将选项合并到单个哈希中:

  chart.draw(data, {'displayAnnotations':true,
'zoomStartTime':new Date(2011,6,26),
'zoomEndTime':new Date(2011,6,30)
}
);


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?

解决方案

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)
                  }
           );

这篇关于配置Google注释时间线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆