novus / nvd3

A reusable charting library written in d3.js
http://nvd3.org/
Other
7.22k stars 2.14k forks source link

d3.time.scale compatibility (automatic time ticks) #936

Open dlu306090 opened 9 years ago

dlu306090 commented 9 years ago

There was an issue opened a year or so ago (d3.time.scale compatibility #145), and the result of that was that nvd3 was able to allow dates to be shown on the x axis. However, in the lineWithFocusChart, when the brushed area selected is very small, I would like for the format on the x axis to change. Is there any way to do this? i.e. if less than a day interval is selected, I want the format in time(hh:mm:ss) rather than dates(mm/dd/yy). This the original d3 time scale automatically does this (see http://bl.ocks.org/mbostock/1667367), but I can't seem to get it to work with the nvd3 lineWithFocusChart.

jufemaiz commented 9 years ago

You'll need to use a custom x-axis formatter.

https://github.com/novus/nvd3/issues/573