Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 Shapes - Stacked Area - .offset(d3.stackOffsetExpand)

Public visualization

D3 Shapes - Stacked Area - .offset(d3.stackOffsetExpand)

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

A stacked area chart displays five days of fruit quantities, with each day normalized to a full vertical stack using `d3.stackOffsetExpand`, so the y-axis represents proportional shares. Three colored areas—apricots, blueberries, and cherries—are generated with `d3.area()` and rendered as SVG paths inside an SVG element. The data comes from a hardcoded array, and the chart uses `d3.stack()` with keys for each fruit type, mapping each series to a color from a predefined palette.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed