Skip to content

DocsCharts CLine

PT

Charts C

Line

Smooth series that draw themselves on entry, with a hover for each moment.

data-u="line"Family C

Example

Line chart

Two smooth series that draw themselves on entry. Hover a point in time and the title, number and tiles show that moment.

Installation

Just this chart, with the core and the tokens:

curl -fsSL unslop.leallabs.dev/i | sh -s add line

Dependency Pulls in a-chartc (shell for C charts). The installer downloads it and puts it in the right order.

The full card from the example, as HTML ready to paste:

curl -fsSL unslop.leallabs.dev/i | sh -s add chart-line

Family C: shell u-chartc-card > u-chartc-panel > the data-u, then h3.u-chartc-title and p.u-chartc-desc.

Props

They go in data-u-props, as JSON. Each item in periods becomes an option in the picker and the chart animates from the old data to the new.

PropTypeDefaultWhat it does
labelstringno defaultSmall label at the top of the card.
unitstringno defaultValue suffix, like ms. With latency, a drop is good and the badge turns green.
seriesarrayno defaultList of {label}.
periodsarrayno defaultList of {label, delta, labels, data}. Each period can have a different number of points.
periodnumber0Index of the period that opens selected.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
chart svgrole="img" and aria-label"Label over the period".
period listrole="listbox", role="option"Opens with aria-expanded and marks the option in aria-selected.

Keyboard

KeyDoes
Enter or Spaceopens the period list
Up and down arrowsmoves through the options
Esccloses without changing
Tabcloses and moves focus on

Events and API

No public events. The period change happens inside the card.

Type to search. Arrows pick, Enter opens.