Want to fix the label crowding? Check out the version by Ziggy that dynamically positions the labels. Mike Bostock suggested constraint relaxation, which works very well.
This line chart is constructed from a CSV in the "Multi-Series Format" from Bureau of Labor Statistics Consumer Price Index data. The chart employs conventional margins and a number of D3 features:
- d3.csv - load and parse data
- d3.time.format - parse dates
- d3.time.scale - x-position encoding
- d3.scale.linear - y-position encoding
- d3.hcl - a perceptual color space
- d3.extent, d3.min and d3.max - compute domains
- d3.svg.axis - display axes
- d3.svg.line - display line shape
The chart also uses a couple functions from Underscore.js: