Skip to main content
100%

Diverging Bar chart in D3

✓ Published1🌍 Public
EEunice Tu
Last edited Mar 2, 2024
Created on Mar 1, 2024
Forked from D3 Starter

This diverging bar chart visualizes population percent changes across U.S. states between April 2020 and July 2019, using horizontal bars that extend left or right from a central zero axis. The visualization first loads CSV data via `d3.csv`, then applies `d3.scaleLinear` for axes and bar lengths, `d3.scaleBand` for the categorical y-axis, and `d3.scaleSequential` with an `interpolateRdBu` color scheme. A color legend is generated using `d3.legendColor` from the d3-legend plugin, while bars are rendered as SVG `<rect>` elements. The chart includes axis labels, a title, and subtitle, all styled with D3 v7.

AI-generated description

The dataset 'State Demographics' from the CORGIS Dataset Project. 'https://corgis-edu.github.io/corgis/csv/state_demographics/'

MIT Licensed

Similar vizzes