【发布时间】:2013-10-07 15:55:27
【问题描述】:
我将继续使用具有时间序列的 Dygraphs。我在这里遵循了文档: http://dygraphs.com/annotations.html 在这里:http://dygraphs.com/gallery/#g/annotations
我的 x 轴是一个 javascript Date() 对象。经检查,我与 Dygraphs 一起使用的时间序列数组示例如下:
[[Wed Sep 25 2013 00:00:00 GMT+0100 (GMT Daylight Time), 5.311174814188838, 11],
[Wed Sep 25 2013 01:00:00 GMT+0100 (GMT Daylight Time), 5.313242976801092, 11],
[Wed Sep 25 2013 02:00:00 GMT+0100 (GMT Daylight Time), 5.310303423288409, 11],
[Wed Sep 25 2013 03:00:00 GMT+0100 (GMT Daylight Time), 5.301762506225051, 11]]
系列可以是“A”和“B”。无论我如何尝试设置注释,它都不起作用。例如,
annDate = new Date('2013 09 25');
g.setAnnotations([
{
series: "A",
x: annDate,
shortText: "L",
text: "Coldest Day"
}
]);
我曾尝试将日期直接指定为字符串,例如“2013-09-25”等,但无法在图表上显示注释。
编辑 在这里摆弄:http://jsfiddle.net/be8s6/3/
【问题讨论】:
-
请提供演示链接,最好通过 dygraphs.com/fiddle
标签: datetime time-series dygraphs