Skip to main content
100%

Stacked-bar-example

✓ Published3🌍 Public
GGabriel Ing
Last edited Jan 30, 2025
Created on Jan 29, 2025
Forked from HTML Starter

This stacked bar chart displays the distribution of three subgroups across multiple categorical groups, with each bar segment colored distinctly to show proportional composition. The visualization uses D3 v7 to load CSV data via `d3.csv` from a GitHub-hosted dataset, then applies `d3.stack()` and `d3.scaleBand()` to structure and position the bars. Colored segments are rendered as SVG rectangles using `d3.scaleOrdinal` for color mapping, with axes generated through `d3.axisBottom` and `d3.axisLeft`.

AI-generated description

example copied from d3-graph-gallery

MIT Licensed

Similar vizzes