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
| Show | Old schedule | New schedule | Change |
|---|---|---|---|
| Morning Brief | 42k | 58k | +16k |
| Deep Dive | 31k | 36k | +5k |
| Weekend Chat | 27k | 22k | −5k |
| Tech Corner | 18k | 29k | +11k |
| Local News | 15k | 14k | −1k |
datais a list of rows. Each row has alabel, astartvalue, and anendvalue.- The start dot is gray and hollow. The end dot is filled, in
color(defaultchart-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.
formatsets the text of a value. - For screen readers, the chart is a table with the two values and the change of each row.
labelnames the table. Change the words withlabelsor a label pack:start(default "Before"),end(default "After"),row, andchange.
Usage
ts
import { BlessDumbbell } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
data* | BlessDumbbellRow[] | — | |
color | string | "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 + "%"` |
label | string | "Chart" | names the chart and its table for screen readers |
labels | Partial<{ start: string; end: string; row: string; change: string; }> | — |