为谷歌图表的带注释的时间线添加数据

Add data for Annotated time line of Google Chart with time

本文关键字:时间线 添加 数据 注释 谷歌      更新时间:2023-09-26

如何为谷歌图表的带注释的时间轴添加数据随时间变化? 如:

[新日期(2008, 1 ,1), 时间(12.2.30), 30000, 未定义, 未定义, 40645, 未定义, 未定义],

官方网站上没有演示,可以吗?

Javascript Date 对象支持指定小时、分钟、秒和毫秒:

new Date(year, month, day, hours, minutes, seconds, milliseconds);

因此,如果要在日期中指定一天中的时间,则只需添加适当的参数即可。 在您的示例中,它将是:

new Date(2008, 1, 1, 12, 2, 30) // 12:02:30 February 1, 2008