Yeah, I know.. I believe Tufte calls that range axes. I was hoping that was enough, but the boss said that our users have been accustomed to having the max and min label show, and really like that.
I just implemented that into NVD3 on the Y axis, still gotta do the x which is slightly more complex, will likely get to that tomorrow, if not, Monday. The code's a little ugly since I was getting 0 height and width when I was doing getBBox() on the tick's text elements (didn't have time to investigate why, so for the time being, I just assumed the text height was 16px... I will probably redo that later so that the user can change the font size in the CSS without having issues).
The other feature I'm planning to add (at least into my axis wrapper that has an optional axis label) is to calculate the overall width of the axis (not the lines, just the width of that largest label, plus the tickPadding... and in my case, plus the axis label if there is one). This way the space taken up by the axis represents the actual space the axis needs to fully render. This is especially important for my horizontal bar example, if the text labels are very long in some cases, and in others short, I don't want to have to manually set the width. I'll also add an optional max width and clip the text that exceeds that (I'm already doing that on my discrete bar model to prevent the text from overlapping). And maybe a little while later, I may implement a text wrapping feature for long labels, just got a list of other more important features I wanna finish before I get to that.
You can check out how they look on most of my examples (
http://novus.github.com/nvd3/ghpages/examples.html). One problem I need to work out can be seen on my cumulative line example (
http://novus.github.com/nvd3/ghpages/cumulativeLine.html) where the rounded max (from the tickFormat function) is the same value as the first tick. The easiest solution would be to make the tickFormat show a decimal point, or possibly have the Max and Min use a different more precise formatter (which is an idea I'm not crazy about). On the other hand, having similar problems in a few spots, while I don;t want to make it painful on the user, there are multiple spots formatting the same value that different amounts of precision may be wanted (like the y axis vs. the tooltips vs. the labels shown on the chart (as seen on the discrete bar and horizontal bar examples I have)). The user may want to set different ones, but at the same time, I don;t want to make them set the format in 3 different places every time. I'll probably just do something like: format = tooltipFormat || yAxis.tickFormat()
Bob