I'm trying to make a zoomable chart with time scale on the x axis.
The default behaviour with an xScale like so:
var x = d3.time.scale()
.domain([getDate(minDate), getDate(maxDate)])
.range([0, width]);
and an xAxis like so:
var xAxis = d3.svg.axis()
.scale(x);
is almost what I'm after.
But I'd like to have a custom Time Format that shows years, and instead of showing the name of the month, shows just a tick line, without the text (and maybe add a class to these ticks), while still retaining the default behaviour of the axis on zoom.
Any help would be much appreciated.
Edit: I imagine that Lars' answer here would be a good approach, so long as it could be applied to a zoomable chart. Any fresh thoughts?