Sparkline
Show a short trend with its last observation and the underlying values.
alpina-ui/ui/sparklineWater level across four readings, in metres.
Data table
| Time | Metres |
|---|---|
| 06:00 | 18 m |
| 09:00 | 16 m |
| 12:00 | 17 m |
| 15:00 | 14 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.
| Key | Action |
|---|---|
| Tab | Focus the data-table disclosure when readings are available. |
| Enter / Space | Show 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
npx --no-install alpina add sparkline