score:5

Accepted answer

Maybe the data.report array is not sorted by timestamp (the sample provided is unsorted). In your code, you assume that those values are sorted. You can try using

// Compute the timestamp extent
var timeExtent = d3.extent(data.report, function(d) { return d.timestamp; });

dc.barChart("#graphTimeOverview")
    // more settings here
    .x(d3.time.scale().domain(timeExtent.map(function(d) { return new Date(d); })))
    .round(d3.time.hour.round)
    .xUnits(d3.time.hours)
    .renderHorizontalGridLines(true);

It would be easier to tell what is the problem if you provide a jsFiddle.

score:0

I started using dc.js few days ago, so I don't know for sure. But, I think your code should go in

d3.csv("data.csv", function(data) { //your-code }; or d3.json("data.json", function(data) {//your-code}; or jQuery.getJson("data.json", function(data){//your-code});


Related Query

More Query from same tag