Skip to main content
100%

D3: Stack layout stacked bar chart

✓ Published0🌍 Public
DDebaliena
Last edited May 23, 2022
Created on May 23, 2022
Forked from HTML Starter

This stacked bar chart uses D3’s `d3.stack` layout to divide five categories into layered segments for apples, oranges, and grapes. Each series is rendered as SVG `rect` elements within grouped `<g>` elements, with `d3.scaleBand` positioning bars along the x-axis and `d3.scaleLinear` mapping cumulative values to heights. Colors come from `d3.schemeCategory10`, and the chart reads the static dataset directly from the script.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes