Question

I am having trouble implementing Rickshaw on a very simple data set. Even though I'm feeding Rickshaw specific epoch times, it isn't labeling the x-axis correctly. Any idea why the timestamps aren't being interpreted correctly?

Here's my code:

var data = [ 
    { x: 1393526720569, y: 14.00 }, // Thu, 27 Feb 2014 18:45:20 GMT
    { x: 1393527620601, y: 25.86 }, // Thu, 27 Feb 2014 19:00:20 GMT
    { x: 1393528520452, y: 54.86 }  // Thu, 27 Feb 2014 19:15:20 GMT
    ];

var graph = new Rickshaw.Graph({
    element: document.querySelector('#chart'),
    renderer: 'area',
    width: 1000, 
    height: 350,
    series: [ {
        data: data,
        color: '#ccc'
    }] 
});

var axes = new Rickshaw.Graph.Axis.Time( { graph: graph } );
var hoverDetail = new Rickshaw.Graph.HoverDetail( { graph: graph } );
graph.render();
Was it helpful?

Solution

Found the answer. My epoch timestamps were to granular. Rickshaw expected seconds NOT milliseconds: 1393526720 not 1393526720569.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top