Grouped Bar Chart with Crossfilter
This grouped bar chart visualizes state populations by age range, with states on the x-axis and population on the y-axis using a linear scale with SI formatting. Each state is divided into age-group bars, colored distinctly, with a legend. The chart uses crossfilter to dimension, group, and aggregate the CSV data, computing nested structures via d3.nest to organize values by state and age range. Margins frame the SVG, axes are generated with d3.svg.axis, and the population encoding uses d3.scale.linear with d3.format for compact labels.
AI-generated descriptionThis is a fork of mbostock's grouped bar chart example, to demonstrate how to use crossfilter to produce the same result.
This grouped bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:
- d3.csv - load and parse data
- d3.scale.ordinal - x-position encoding and color encoding
- d3.scale.linear - y-position encoding
- d3.format - SI prefix formatting (e.g., “10M” for 10,000,000)
- d3.max - compute domains
- d3.keys - compute column names
- d3.svg.axis - display axes
forked from <a href='http://bl.ocks.org/danroberts/'>danroberts</a>'s block: <a href='http://bl.ocks.org/danroberts/cc6f3159f49fed6f6a8d'>Grouped Bar Chart with Crossfilter</a>
forked from <a href='http://bl.ocks.org/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/edaed15ec54acfd254c22ea46abe0ee1'>Grouped Bar Chart with Crossfilter</a>