Skip to content

DocsCharts CBar list

PT

Charts C

Bar list

Ranking in horizontal bars, with the label inside the bar and the value beside it.

data-u="barlist"Family C

Example

Top pages

Bar list with the label inside the bar and the value on the right. Hover a row and the others fade.

Installation

Just this chart, with the core and the tokens:

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

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-barlist

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.
periodsarrayno defaultList of {label, delta, total, items: [{label, value}], stats: [{label, value}]}. stats become tiles, with the value already as text.
periodnumber0Index of the period that opens selected.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
listrole="list", role="listitem"Each bar is an item with an aria-label of label and value.
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.