Appearance
Are you an LLM? You can read better optimized documentation at /embed/docs/chart-types/stacked-area.md for this page in Markdown format
Stacked area
Filled stacked series over an ordered domain (absolute or normalised to 100%).
Identity
chartType | stackedArea · stackedArea100 |
| Option bag | area |
seriesData layout | seriesRows – row 0 = category header; later rows = series |
| Min grid | 2 rows × 2 columns (header included) |
| Orientation | Yes – vertical (default) or horizontal |
| Sample | Stacked area |
Minimal chartData
js
{
chartType: 'stackedArea', // or 'stackedArea100'
isDataTransposed: true,
seriesData: [
['', 'Q1', 'Q2', 'Q3', 'Q4'],
['Series A', 20, 28, 26, 32],
['Series B', 12, 14, 18, 16],
],
title: { visible: true, text: 'Area mix' },
subtitle: { visible: false, text: '' },
}seriesData
Same seriesRows layout as line / bar (isDataTransposed: true):
js
[
['', 'Q1', 'Q2', 'Q3', 'Q4'],
['Series A', 20, 28, 26, 32],
['Series B', 12, 14, 18, 16],
]Shared layout rules: chartData schema · seriesData.
Option bag: area
Both stacked area types read cd.area.
| Field | Default (new charts) | Role |
|---|---|---|
width | 2 | Stroke width (px) |
strokeDashArray | '' | Dash pattern |
drawPoints | false | Point markers on the upper edge |
curveParameter | 1 | Curve tension (same idea as line smoothness) |
fillOpacity | 0.6 | Solid fill opacity |
fillType | 'solid' | 'solid' | 'gradient' |
fillOpacityTop / fillOpacityBottom | 0.35 / 0.05 | Gradient stops when fillType: 'gradient' |
gradientTarget | 'transparent' | Gradient fade target |
strokeOpacity | 1 | Stroke opacity |
shadowIntensity | 0 | Soft shadow |
pointMarker | (same shape as line) | Markers when drawPoints is on |
dataLabels / overrides | empty | Label / style patches |
js
{
chartType: 'stackedArea',
seriesData: [/* … */],
area: {
fillOpacity: 0.45,
drawPoints: false,
},
}Markers: Point markers.
Axes & scales
| Role | Vertical | Horizontal |
|---|---|---|
| Domain | bottom | left |
| Primary range | left | bottom |
- Absolute stacks (
stackedArea) usually keep 0 in range. stackedArea100uses a 0–100%value axis (same interval rules as other 100% types).- Secondary axis is uncommon; prefer line or combo for dual units.
Details: Axes · by chart type · Percent axis sample.
Type-specific behaviour
- Do not put area options on
cd.line– that is a foreign bag. - Palette:
legend.colors.
Pitfalls
- Using
chartType: 'line'witharea: {…}(or the reverse) - Expecting a single non-stacked “area chart” type – public types are the stacked variants
- Fighting 0–100 bounds / tick intervals on
stackedArea100 - Turning on
drawPointswithout checking marker clutter on dense domains
Related
- Line · Stacked bar
- chartData schema · Axes
- Sample: Stacked area