Skip to content

Stacked area

Filled stacked series over an ordered domain (absolute or normalised to 100%).

Identity

chartTypestackedArea · stackedArea100
Option bagarea
seriesData layoutseriesRows – row 0 = category header; later rows = series
Min grid2 rows × 2 columns (header included)
OrientationYes – vertical (default) or horizontal
SampleStacked 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.

FieldDefault (new charts)Role
width2Stroke width (px)
strokeDashArray''Dash pattern
drawPointsfalsePoint markers on the upper edge
curveParameter1Curve tension (same idea as line smoothness)
fillOpacity0.6Solid fill opacity
fillType'solid''solid' | 'gradient'
fillOpacityTop / fillOpacityBottom0.35 / 0.05Gradient stops when fillType: 'gradient'
gradientTarget'transparent'Gradient fade target
strokeOpacity1Stroke opacity
shadowIntensity0Soft shadow
pointMarker(same shape as line)Markers when drawPoints is on
dataLabels / overridesemptyLabel / style patches
js
{
  chartType: 'stackedArea',
  seriesData: [/* … */],
  area: {
    fillOpacity: 0.45,
    drawPoints: false,
  },
}

Markers: Point markers.


Axes & scales

RoleVerticalHorizontal
Domainbottomleft
Primary rangeleftbottom
  • 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 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' 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

Developer documentation for ChartBuddy Embed · Not the end-user Help Center · Help Center