Skip to content

Spark line

A sparkline is a tiny chart that provides a visual representation of data. Use sparklines to show trends in a series of values, such as seasonal increases or decreases, economic cycles, or to highlight maximum and minimum values. Position a sparkline near its data for greatest impact.

Basic

The sparkline component is fully responsive and recalculates (with a debounce) to any dimension you set with css. Color can be set to the usual primary, secondary, tertiary

With min max set

By default the sparkline auto scales to the peak values in its buffer. By setting a static max & min value this behavior can be overridden

Hover to show value

Setting the hoverable prop makes the sparkline display a thin line at the current pointer position and a tooltip showing the indexed value

Slot(s) and slot props

The sparkline component exposes the peak (min & max) values in the default slot. It also has a slot named tooltip which exposes an index and the raw data buffer. With these its fairly trivial to add some extra details and a custom tooltip

0 ℃
0 ℃

Not really.