If you want to use the ordinal scale's rangeBands, then use a time
interval to generate an array of all the times you want to display.
For example, if you want to display one rect per day, you might say:
var x = d3.scale.ordinal()
.domain(d3.time.days(new Date(2011, 0, 1), new Date(2011, 3, 1)))
.rangeRoundBands([0, width], .1);
If you want to generate pretty labels for this, you can use
d3.svg.axis. You can generate a d3.time.format and pass that to
axis.tickFormat.
Mike
I'm kind of back where I started with this problem. The solution you
suggested works, but the problem I'm facing with label overplotting
still exists. It seems like I have two options:
1. Use a d3.time.scale instance and then calculate my own range band
widths. This would give me the pretty axis labels and eliminate
overplotting. A disadvantage would be the labels wouldn't line up with
the bars themselves, but with the space between bars, which I'm
alright with.
2. Hack together an ordinal scale with a tick function that implements
a #ticks method so that it behaves a bit more like the quantitative
scales.
Do you have any thoughts? In the crossfilter example you manually draw
bars with a path element and a specific function for rendering the
path. If I can, I'd like to avoid that so I can attach event handlers
to each bar via rect elements.
Thanks again,
Nate