Skip to content

hd-sparkline

Live preview

<hd-sparkline range="24h">  <hd-series bind="{{ cap.measure_power }}"></hd-series></hd-sparkline>

Attributes and example

hd-sparkline

A small history line with live updates, an hd-series inside per line (up to 3, any devices, also for one line); no axes, legend or tooltip, so label the lines around it. Lines with the same unit share a scale.

AttributeWhat it is
rangeHow far back: 1h, 6h, 24h, 7d, 30d, 1y.Default 24h.
resolutionBucket size; a larger one calms a busy line down to averages.One of auto, raw, 1m, 5m, 15m, 1h, 1d. Default auto.
aggregateHow buckets are combined; each hd-series can have its own.One of avg, min, max, last, delta. Default avg.
variantA line, a filled area, columns, stacked columns, or steps; each hd-series can have its own.One of line, area, bar, stacked, step. Default area.
smoothGently curved lines.Default false.
liveKeep adding live points.Default true.
<hd-sparkline range="24h">  <hd-series bind="{{ cap.measure_power }}"></hd-series></hd-sparkline>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

--hd-accent
The theme’s accent: active controls, links, highlights.
--hd-font-ui
The font of labels and running text.
--hd-text
Text and big numbers.
--hd-text-faint
The quietest text: hints, units, times.

Style the host

hd-sparkline {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables