Skip to main content
100%

Horizontal Stacked Bar Chart

✓ Published0🌍 Public
Aandrew-reid
Last edited Mar 16, 2017
Created on Feb 2, 2017

This horizontal stacked bar chart visualizes U.S. population by state, broken down into seven age brackets. Built with D3 v4 and rendered as SVG, the chart sorts states by total population, with each bar segmented using a categorical color scale. The horizontal layout makes state labels easy to read, and the stacked segments show the age distribution for each state. The data is loaded from a CSV file and processed with d3.stack() to compute the segment boundaries, with a linear x-scale for population and a band y-scale for states.

AI-generated description

A demonstration of translating a vertical stacked bar chart, Mike Bostock's block here: https://bl.ocks.org/mbostock/3886208.

Commented sections show changes from Bostock's example.

Similar vizzes