Skip to content

DocsCharts BRings

PT

Charts B

Rings

Goals in three rings or a month of mini rings per day.

data-u="rings"Family B

Example

Goal rings

Three concentric rings that fill up with the day's goal. Hover a ring to read its progress in the center.

Ring calendar

The same idea in miniature: every day of the month gets three rings. The picker changes the month with a transition.

Installation

Just this chart, with the core and the tokens:

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

Dependency Pulls in b-shell (shell for B 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-rings

Family B: shell u-chartb-card > the data-u with the u-chartb-panel class, then div.u-chartb-copy with h3 and p.

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.
variantstringno default"activity" (three rings) or "calendar" (mini rings per day).
ringsarrayno defaultactivity: the three names.
periodsarrayno defaultactivity: list of {label, pct, text}, pct from 0 to 1.
unitstringno defaultcalendar: unit for the total.
hoverUnitstringno defaultcalendar: unit in the day hover.
monthnumberlastcalendar: month it opens on.
monthsarrayno defaultcalendar: list of {label, days, start, total, seed}. start is the weekday of day 1 (0 is Sunday).
periodnumber0Index of the period that opens selected.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
chart svgrole="img" and aria-label"Label".
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.