Skip to content

DocsCharts AArea

PT

Charts A

Area

Stacked series with gradients and a hover that follows the month.

data-u="area"Family A

Example

Area chart

Stacked series with gradient fills. Hover a month and the title, legend and tiles follow it.

Installation

Just this chart, with the core and the tokens:

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

No dependency The chart file already brings its own shell.

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

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

Family A: shell u-chart-card > u-chart-panel > the data-u, then h3.u-chart-title and p.u-chart-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.
seriesarrayno defaultList of {label}, one per series.
periodsarrayno defaultList of {label, delta, labels, data}. data has one array per series, one value per label.
periodnumber0Index of the period that opens selected.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
chart svgrole="img" and aria-label"Label by month".
period togglerole="radiogroup", role="radio"Current period in aria-checked.
period listrole="listbox", role="option"Opens with aria-expanded and marks the option in aria-selected.

Keyboard

KeyDoes
Left and right arrowschange the period in the toggle
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.