When to use an area chart
Area charts emphasize magnitude over time, and stacking shows how parts add up to a total.
- Revenue by product over quarters
- Traffic by source, stacked to a total
- Share of usage by plan (100% stacked)
Data format
- Column 1 is the time axis; each other column is an area.
- Paste CSV, JSON from your API, TSV copied from Excel or Google Sheets, or a Markdown table. The generated component keeps your column names as its data keys.
Quarter,Product A,Product B,Product C
Q1,12000,8000,5000
Q2,15000,9500,6200
Q3,18000,11000,7800
Q4,22000,13500,9100[
{"quarter": "Q1", "productA": 12000, "productB": 8000, "productC": 5000},
{"quarter": "Q2", "productA": 15000, "productB": 9500, "productC": 6200},
{"quarter": "Q3", "productA": 18000, "productB": 11000, "productC": 7800},
…
]Options
- Overlap / Stacked / 100%
- Overlapping translucent areas, a stacked total, or normalized shares.
- Tooltip
- Breakdown tooltip or shadcn's default.
- Colors
- Custom color per series; gradients follow the color.
How to add it to your project
- 1. Add the shadcn/ui chart component (it installs Recharts):
npx shadcn@latest add chart - 2. Paste your data above, pick the options, and copy the generated
chart.tsx. - 3. Save it in your project (e.g.
components/area-chart.tsx) and render<Chart />, or<Chart data={rows} />in Data as prop mode.
Area Chart FAQ
Each series gets an SVG linearGradient from its color at 85% opacity down to 4%. The IDs are scoped with React's useId, so two charts on one page never clash.
When the total matters as much as the parts, like traffic by source. For comparing series that don't add up, use overlapping areas or a line chart.
Yes. Switch to Data as prop and pass rows with the same field names you pasted.