--- url: https://chartbuddy.io/embed/docs/chart-types/stacked-area.md --- > Docs index: [llms.txt](https://chartbuddy.io/embed/docs/llms.txt) # 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](https://chartbuddy.io/embed/docs/samples/stacked-area.md) | *** ## 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](https://chartbuddy.io/embed/docs/api/chart-data.md#seriesdata-layouts). *** ## 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](https://chartbuddy.io/embed/docs/configuration/point-markers.md). *** ## Axes & scales | Role | Vertical | Horizontal | |---|---|---| | Domain | `bottom` | `left` | | Primary range | `left` | `bottom` | * Absolute stacks (`stackedArea`) usually keep **0 in range**. * `stackedArea100` uses a **0–100** `%` value axis (same interval rules as other 100% types). * Secondary axis is uncommon; prefer [line](https://chartbuddy.io/embed/docs/chart-types/line.md) or [combo](https://chartbuddy.io/embed/docs/chart-types/combo.md) for dual units. Details: [Axes · by chart type](https://chartbuddy.io/embed/docs/axes/by-chart-type.md) · [Percent axis sample](https://chartbuddy.io/embed/docs/samples/percent-axis.md). *** ## Type-specific behaviour * Do not put area options on `cd.line` – that is a foreign bag. * Palette: `legend.colors`. *** ## Pitfalls * Using `chartType: 'line'` with `area: {…}` (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 `drawPoints` without checking marker clutter on dense domains *** ## Related * [Line](https://chartbuddy.io/embed/docs/chart-types/line.md) · [Stacked bar](https://chartbuddy.io/embed/docs/chart-types/stacked-bar.md) * [chartData schema](https://chartbuddy.io/embed/docs/api/chart-data.md) · [Axes](https://chartbuddy.io/embed/docs/axes.md) * Sample: [Stacked area](https://chartbuddy.io/embed/docs/samples/stacked-area.md)