Skip to content

Sparkline

Show a short trend with its last observation and the underlying values.

alpina-ui/ui/sparkline

Interactive preview

Reservoir level

Water level across four readings, in metres.

Data table
TimeMetres
06:0018 m
09:0016 m
12:0017 m
15:0014 m

Usage notes

Show a short trend with its last observation and the underlying values. Pass title, description and data with label and value for each observation. Use loading while fetching data and formatValue for units.

When to use

Add a compact trend beside a current reading in a monitoring summary.

When to avoid

Use a full chart if readers need axes, precise comparisons or an explanation of a sudden change.

Accessibility

Name the quantity, unit and interval in text. Keep the latest observation and data disclosure available independently of the line.

Keys
KeyAction
TabFocus the data-table disclosure when readings are available.
Enter / SpaceShow or hide the same values in the accessible table.

Content

Pair a brief measure name with its final value. Give the time window in a caption rather than squeezing it into the graphic.

Use
Reservoir level / 14 m at 15:00
Avoid
A line with no unit or time

Copy in four languages

German
Wasserstand11 characters
French
Niveau de l’eau15 characters
Italian
Livello dell’acqua18 characters
Romansh
Nivel da l’aua14 characters
Add to your project
npx --no-install alpina add sparkline