Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 Shapes - Stacked Bar

Public visualization

Viewing a saved revision (read-only)

ddc8738660444be2ba65df93e95a0349

D3 Shapes - Stacked Bar

0 stars1🌍 Public
SSubhendu Karmakar
Last edited Jan 1, 2024
Created on Jan 1, 2024

This stacked bar chart visualizes five days of fruit quantities, with three series (apricots, blueberries, cherries) shown as horizontal segments per day. The chart uses D3 v7’s `d3.stack()` to compute the cumulative y-values for each series, then binds the stacked data to SVG `rect` elements. Series colors are applied via a static array, and day labels are rendered as SVG text. The visualization demonstrates stacking without axes, focusing on the proportional differences between fruit categories across the week.

AI-generated description