我正在使用javascript人力车库来可视化图表中的实时数据。有人知道为什么x轴的时间戳开始于"01 Jan 1970 00:00:00GMT“而不是当前的时间戳吗?
这里的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')
} );谢谢。
发布于 2014-09-22 19:03:47
我已经找到了问题的根源。函数Rickshaw.Fixtures.RandomData(150)将时间戳添加到数据。时间戳在Rickshaw.Fixtures.Time中定义。
https://stackoverflow.com/questions/25968577
复制相似问题