All components (283)
Radial bars
Data · RadialBarChart · .amset-radialbar
What it is and when to use it
Several measures against the same ceiling, each in its own ring: how much of each goal is done, the use of each quota. Unlike a split ring, each ring fills on its own and they are compared by how close they are to going all the way round.
When to use it
- Several measures of the same kind with the same ceiling (quarter goals, plan quotas).
itemsare the rings, the first one outermost:{ key, label, value, tone? }.maxsays what a full ring is worth; without it, the largest value.
When not to
- Parts of a total that add up to everything:
DonutChart. - A single measure:
RingProgress. - Comparing values precisely:
BarChart.
Keyboard: Tab goes to the drawing and the arrows move from ring to ring, with a spoken notice.
Accessibility: it is an image (role="img") with a written summary and underneath goes a real table. Each ring has its name, its value and its percentage written out in the legend.
Fine-tuning: --amset-radialbar-size is the diameter, --amset-radialbar-thickness the thickness (in drawing units, out of 100) and --amset-radialbar-track the colour of the background.
What it looks like
<RadialBarChart
label="Quarter goals"
items={[
{ key: "ventas", label: "Sales", value: 82 },
{ key: "altas", label: "Sign-ups", value: 64 },
{ key: "tickets", label: "Tickets", value: 41 },
]}
max={100}
/>Props
Import it with import { RadialBarChart } from '@amset/ui'. Required props are marked.
| Prop | Type | What it does |
|---|---|---|
itemsrequired | readonly WaffleItem[] | The rings, the first one outermost: `{ key, label, value, tone? }`. |
labelrequired | string | What is being measured. Required: a chart without a title tells nothing. |
className | string | Merged with the library classes; it does not replace them. |
error | ReactNode | — |
format | (value: number) => string | — |
loading | boolean | — |
max | number | What a full ring is worth. Without it, the largest value. |
tableVisible | boolean | — |
It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.
CSS variables
These CSS variables are how you adapt it. Declare them on the component's selector, not on :root: the stylesheet redeclares them in the rule itself, and a declaration on the same element always wins.
| Variable | Default |
|---|---|
--amset-radialbar-size | 14rem |
--amset-radialbar-thickness | 5 |
--amset-radialbar-track | var(--amset-border) |
How to change it
.amset-radialbar {
--amset-radialbar-size: ...;
--amset-radialbar-thickness: ...;
}In the test bench
Every state and variant, to try one at a time, on its page at storybook.amsetui.com:
