1

This is similar to issue reported here.

In this sample working example, I have implemented a line chart and a historical chart.

chart.xAxis
    .showMaxMin(true)
    .tickFormat(function(d) { return d3.time.format('%b %d')(new Date(d)) })

Everything thing works as expected, except that axis lables in x-axis are not in sync with line points or the bar.

As the solution suggested in this issue says that it is due to formatting of date, I have tried to format date/time in my new example. But the issue remains same.

chart.xAxis
    .showMaxMin(true)
    .tickFormat(function(d) { return d3.time.format('%b %d %Y')(new Date(d)) })

To me it initially looked an issue of NVD3 library cause same formatting works perfectly for other chart types I checked. Thus I raised an issue here.

1 Answers1

1

You need to set the xScale. Do chart.xScale(d3.time.scale())

jeznag
  • 4,183
  • 7
  • 35
  • 53