Skip to content

hd-chart

Live preview

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

Attributes and example

hd-chart

A history chart with an hd-series inside per line (up to 8, any devices, also for one line); can sit behind the widget content as a background. Lines with the same unit share an axis, a second unit goes on the right; from two lines on it has a legend, and its tooltip lists every line at that moment.

AttributeWhat it is
rangeHow far back: 1h, 6h, 24h, 7d, 30d, 1y.Default 24h.
fromStart time (ISO), instead of range.
toEnd time (ISO).
resolutionBucket size.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.
variantChart style: a line, a filled area, columns (side by side for several lines), stacked columns, or steps; each hd-series can have its own, and with several lines only the first is an area.One of line, area, bar, stacked, step. Default area.
placementInline, or behind the content.One of inline, background. Default inline.
smoothGently curved lines.Default false.
liveKeep adding live points.Default true.
<hd-chart range="24h">  <hd-series bind="{{ cap.measure_power }}"></hd-series></hd-chart>

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-font-ui
The font of labels and running text.
--hd-radius-sm
Small corners: chips, small buttons.
--hd-text
Text and big numbers.
--hd-text-faint
The quietest text: hints, units, times.

Style the host

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