谷歌用相对“时间戳”绘制时间线图表
我试图在折线图中可视化每个日期的速度运行时间。我有以下数据:
ID | 日期 | 时间 |
---|---|---|
1 | 2021-10-20 00:00:00 | 1:59:11.19 |
2 | 2021-10-21 00:00:00 | 1:55:33.43 |
3 | 2021-10-22 00:00 :00 | 1:54:52.82 |
4 | 2021-10-23 00:00:00 | 1:53:44.15 |
数据将被转换为数组;
var runs = [
[1, "2021-10-20 00:00:00", "1:59:11.19"],
[2, "2021-10-21 00:00:00", "1:55:33.43"],
[3, "2021-10-22 00:00:00", "1:54:52.82"],
[4, "2021-10-23 00:00:00", "1:53:44.15"]
];
我尝试遵循开发文档中的示例,以及示例< a href="https://jsfiddle.net/api/post/library/pure/" rel="nofollow noreferrer">JSFiddle 没有任何运气。因为它们仅显示支持数字或绝对日期时间/创建时间的示例。
有没有办法使折线图与相对时间(包括毫秒)一起工作,按日期的时间顺序显示所有时间?
I'm trying to visualise speedrun times in a linechart, per date. I have the following data:
ID | Date | Time |
---|---|---|
1 | 2021-10-20 00:00:00 | 1:59:11.19 |
2 | 2021-10-21 00:00:00 | 1:55:33.43 |
3 | 2021-10-22 00:00:00 | 1:54:52.82 |
4 | 2021-10-23 00:00:00 | 1:53:44.15 |
The data will be converted to an array, as such;
var runs = [
[1, "2021-10-20 00:00:00", "1:59:11.19"],
[2, "2021-10-21 00:00:00", "1:55:33.43"],
[3, "2021-10-22 00:00:00", "1:54:52.82"],
[4, "2021-10-23 00:00:00", "1:53:44.15"]
];
I tried following the example from the dev docs, and the example JSFiddle without any luck. As they only show examples that support numbers or absolute datetimes / created times.
Is there a way to make a linechart work with relative times (including ms), showing all times chronologically per date?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想在 x 轴上显示日期并在 y 轴上显示时间,
您可以使用 google 的 timeofday 数据类型来表示-轴
以下是用于构建数据表的例程
,请参阅以下工作片段...
if you are wanting to display the date on the x-axis and the time on the y-axis,
you can use google's timeofday data type for the y-axis
following is routine used to build data table
see following working snippet...