Skip to content
Calm motion: animations on this site only fade, with no movement

Streamgraph ​

Stacked areas around a center line

Shows how a mix changes over time, for example the plays of each topic month by month. The streams sit on top of each other around a center line, so the thickness of the whole is the total. To read exact values over time, use the line chart.

Basic
Plays by topic, January to August
MonthNewsTechCultureSport
Jan42k18k25k12k
Feb40k22k24k15k
Mar37k29k27k21k
Apr35k34k31k26k
May33k38k30k33k
Jun36k41k28k38k
Jul39k40k26k30k
Aug44k37k29k22k
  • data is a list of steps in order. x names the field of a row with the text of its step, such as month.
  • series takes the same series as the bar and the line charts. Each series has a key, an optional label, and an optional color. The first series is the bottom stream.
  • Values below zero count as zero. The legend above the chart names the streams in the same order.
  • If the chart is narrow, the labels under it skip some steps. format sets the text of a value in the table, and height sets the height in pixels (default 260).
  • For screen readers, the chart is a table with a row for each step. label names the table. Change the name of the first column with labels or a label pack: step.

Usage ​

ts
import { BlessStreamgraph } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
data*BlessChartRow[]—one row for each step on the x axis, in order
x*string—the field of a row with the text of its step, for example the month
series*BlessChartSeries[]—one stream for each series; the first is the bottom one
heightnumber260
format((v: number) => string)—text for one value, for example `(v) => v + "k"`
labelstring"Chart"names the chart and its table for screen readers
labelsPartial<{ step: string; }>—

Released under the MIT License. Character names and artwork belong to their owners.