Skip to content

hd-series

Attributes and example

hd-series

One line of an hd-chart (up to 8) or hd-sparkline (up to 3), written inside it, also for a chart of one line; draws nothing itself. Lines with the same unit share an axis, a different unit goes on the right (two axes at most); from two lines on the chart has a legend, and its tooltip lists every line at that moment with its unit. A line whose device is unavailable steps back and says so; lines over the limit are left out (the editor’s preview and its problems say so, a dashboard doesn’t). A readings setting fills them with a {% for %}: <hd-series bind="{{ r.cap }}" label="{{ r.label }}">.

AttributeWhat it is
bindrequiredThe capability it draws, e.g. {{ settings.solar.cap.measure_power }} (the whole capability, no .value); or readings added up and subtracted, each signed: {{ a }} +{{ b }} -{{ c }}.
labelIts name in the legend and tooltip; the capability’s title by default (its device’s name where two lines would read the same).
colorA theme colour name or #rrggbb; the theme’s chart colours in order by default (repeats are dashed).
aggregateHow a bucket’s values combine: the average, lowest, highest or last; delta is a meter’s use per bucket. The chart’s by default.One of avg, min, max, last, delta.
variantA line, a filled area, columns or steps. The chart’s by default; with several lines only the first is an area.One of line, area, bar, step.
axisauto: the same unit shares an axis, a second unit goes right; or keep it left or right.One of auto, left, right. Default auto.
<hd-chart range="24h">  <hd-series bind="{{ settings.solar.cap.measure_power }}" label="Solar" color="lit"></hd-series>  <hd-series bind="{{ settings.outside.cap.measure_temperature }}" label="Outside" variant="line"></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.

No component-specific CSS variables are exposed. Use the host element’s sizing and the documented theme variables.

Style the host

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