← All templates

堆叠面积图 <StackedArea />

2–6 层面积叠成总量(或 100%),右端标每层名称与最新值;逐条展开时从底层往上一层层加。

Template and style descriptions are currently available in Chinese only.

See it in the demo deck →

Group
数据 · 构成随时间变化
Component
StackedArea · #stacked-area

Good for

  • 总量的构成怎样随时间变化
  • 某一层在变厚或变薄

Avoid when

  • 只看一两条趋势:用 LineChart
  • 只有一个时间点:用 Treemap 或 Donut

Content limits

1x 4–30 个点,标签 ≤ 6 个字符;多于 12 个时用 ticks 只标一部分
2series 2–6 层,name ≤ 6 字
3unit ≤ 10 字

Fields

FieldType
kicker · requiredstring标题上方的小节名,2–8 字
title · requiredstring | string[]页面标题;传数组可手动断行,每项一行
leadstring一到两句导语,≤ 60 字
sourcestring事实出处;页面上有任何数据或事实时必填
hintReactNode页眉中间的操作提示,可用 <kbd>
x · requiredstring[]时间点
series · required{ name, values }[]从下到上
mode'value' | 'share'share 按 100% 堆叠
ticksnumber[]要标注的 x 下标
unitstring单位说明
focusstring强调色的层

Example

<StackedArea kicker="结构" title="…" x={years} series={[{ name: '煤电', values: […] }, …]} mode="share" focus="太阳能" />