Skip to main content
100%

Stacked Bar Chart Example

✓ Published1🌍 Public
BBhavanaGIrni
Last edited Jul 21, 2023
Created on Jul 21, 2023
Forked from HTML Starter

This example shows a stacked bar chart comparing three value series across three categories, with each bar segment stacked vertically and colored blue, green, or orange. The chart renders as an SVG using React and D3 v6, drawing rectangles positioned via a band scale for categories and a linear scale for cumulative sums. The code calls `d3.stack()` with keys for value1, value2, and value3, and appends axes with `d3.axisBottom` and `d3.axisLeft`. The dataset is hardcoded in the script.

AI-generated description

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

See also React Starter.

MIT Licensed

Similar vizzes