-
Notifications
You must be signed in to change notification settings - Fork 107
Description
A fairly common use case is to want to displays bucketed data (bars) along a time axis. d3.scaleBand works really well for this and handles a number of alignment issues if you were to try and use d3.scaleTime to plot bars.
However the downside of d3.scaleBand is that it doesn't allow controlling the tick values anywhere near as easily as d3.scaleTime. I think it would be incredibly useful if we could either add support (or add a new d3.scaleTimeBand) which is able to better accommodate time and filtering on the x-axis. I think being able to call .ticks(d3.timeHour.every(4)) for example on a column chart would be very useful.
I think there's assumptions that need to be made to get this working. The way I envisage this working is by using some sort of automatic filter (like one would normally provide to .tickValues() which checks if the time period matches one provided by a helper function such as d3.timeHour.every(4). If the value isn't an hour, that is a multiple of 4 from the start of the first day in the domain then the tick would be filtered out.