1

Is there a simple way to format the date of a d3/nvd3 graph as displayed in the image below?

NVD3 Graph with Axes as Desired i.e. Rather than displaying the whole date against each tick, have the date grouped by date part; so the year is only displayed once, with all months within that year listed above it, then those months with the days listed above them?

I've Googled and at looked at the available D3 formatting options but have so far found no examples or solutions which works in this "grouped" way.

JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
  • [This question](http://stackoverflow.com/questions/11801250/custom-multi-scale-time-formats-in-d3) should help. – Lars Kotthoff Sep 19 '13 at 21:54
  • Thanks @LarsKotthoff. If I've understood correctly, that changes the format used based on the value. What I'm after is to stick to a consistent format, but have avoid repeating the same information when it applies to a consecutive range of values i.e. the year will be the same for a whole group of months, so I don't want to write it for each month, but rather to write it once and show that it applies to a certain group of months). – JohnLBevan Sep 19 '13 at 22:58
  • That should do exactly that. Have you tried applying it to your chart? – Lars Kotthoff Sep 20 '13 at 07:42
  • See: http://stackoverflow.com/questions/10778573/multi-level-grouping-of-axis-labels-using-d3 – JohnLBevan Sep 23 '13 at 14:21

0 Answers0