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

Dumbbell ​

Two values for each row, joined by a line

Shows the gap between two values of the same thing, for example before and after, or the plan and the actual. The length of the line is the size of the change. For many points in time, use the line chart.

Basic
Weekly plays before and after the new schedule
ShowOld scheduleNew scheduleChange
Morning Brief42k58k+16k
Deep Dive31k36k+5k
Weekend Chat27k22k−5k
Tech Corner18k29k+11k
Local News15k14k−1k
  • data is a list of rows. Each row has a label, a start value, and an end value.
  • The start dot is gray and hollow. The end dot is filled, in color (default chart-1). A legend above the chart names the two dots.
  • The axis starts at zero or at the lowest value, and ends at a round number. format sets the text of a value.
  • For screen readers, the chart is a table with the two values and the change of each row. label names the table. Change the words with labels or a label pack: start (default "Before"), end (default "After"), row, and change.

Usage ​

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

API ​

Props

NameTypeDefaultDescription
data*BlessDumbbellRow[]—
colorstring"chart-1"the color of the end dot; the start dot is gray and hollow
format((v: number) => string)—text for one value, for example `(v) => v + "%"`
labelstring"Chart"names the chart and its table for screen readers
labelsPartial<{ start: string; end: string; row: string; change: string; }>—

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