I\'m using nvd3, but I think this is a general d3.js question about time scale and formatting. I\'ve created a simple example that illustrates the problem (see code below):<
Adding on to seliopou's answer, to correctly align the dates with the x-axis, try this:
chart.xAxis
.tickFormat(function(d) {
return d3.time.format('%d-%m-%y')(new Date(d))
});
chart.xScale(d3.time.scale()); //fixes misalignment of timescale with line graph