Skip to main content
100%

Normalized Stacked Bar Chart

✓ Published0🌍 Public
AAndresAnayaIsaza
Last edited Oct 29, 2016
Created on Oct 20, 2016

This example visualizes the results of a referendum by showing the percentage of “No” and “Yes” votes across multiple municipalities, with each bar normalized to 100%. The chart uses a stacked bar layout where each segment’s height reflects its share of the total, making comparisons of proportions easy across categories. Built with D3 v4, the code employs `d3.stack` with `stackOffsetExpand` to compute normalized values, `d3.scaleBand` for the categorical x-axis, and `d3.scaleOrdinal` for segment colors. Data is loaded from a CSV file containing raw vote counts, which are converted to percentages for display.

AI-generated description

This variation of a stacked bar chart shows percentages rather than absolute numbers.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3886394'>Normalized Stacked Bar Chart</a>

gpl-3.0 Licensed

Similar vizzes