【问题标题】:Rickshaw js realtime current time stampRickshaw js实时当前时间戳
【发布时间】:2014-09-22 07:20:04
【问题描述】:

我正在使用 javascript rickshaw 库在图表中可视化实时数据。有谁知道为什么 x 轴的时间戳从“1970 年 1 月 1 日 00:00:00 GMT”而不是当前时间戳开始?

这里的 x 轴时间戳是我想使用的当前时间: http://jsfiddle.net/n68teee2/

在我的项目中,时间戳设置为上面错误的 unix 时间戳: http://jsfiddle.net/t2cch5rw/1/

我认为受影响的代码可能是以下几行:

var hoverDetail = new Rickshaw.Graph.HoverDetail( {
    graph: graph
} );

var annotator = new Rickshaw.Graph.Annotate( {
    graph: graph,
    element: document.getElementById('timeline')
} );

谢谢。

【问题讨论】:

    标签: time diagram rickshaw stamp


    【解决方案1】:

    我找到了问题的根源。 Rickshaw.Fixtures.RandomData(150) 函数将时间戳添加到数据中。时间戳在 Rickshaw.Fixtures.Time 中定义。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-04
      • 2020-11-20
      • 2011-05-08
      相关资源
      最近更新 更多