Grouped Bar Chart with Crossfilter
This grouped bar chart displays state populations across seven age ranges, with each state’s bars clustered along the x-axis and a color-coded legend for age groups. Built with D3.js and Crossfilter, the code loads data via `d3.csv`, uses `d3.scale.ordinal` for positioning and color, `d3.scale.linear` for the y-axis, and `d3.nest` to structure grouped data. Crossfilter dimensions and groups aggregate the CSV records, while `d3.svg.axis` renders axes and `d3.format` applies SI prefixes. The SVG output includes hover-free static bars and a legend.
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/wqm9425/'>wqm9425</a>'s block: <a href='http://bl.ocks.org/wqm9425/ba84edd4b03947ec426f3b0c475e8638'>Grouped Bar Chart with Crossfilter</a>