# Radial Chart

> An animated radial chart for React and shadcn, as progress rings against goals or a gauge with a target.

Concentric progress rings against goals, or a gauge on an open sweep with a target tick. Fills sweep in once and morph by key between ranges; the active ring thickens as the centre rolls to its value.

Also known as a radar chart, a radial graph or a progress ring.

- Tier: Eased Pro
- Interaction: Hover
- Page: https://eased.dev/components/radial-chart
- Installs: motion

## Install

Radial Chart ships with Eased Pro (https://eased.dev/#pricing). Members add the `@eased-pro` registry with their token (https://eased.dev/account), then run:

```bash
npx shadcn add @eased-pro/radial-chart
```

Progress against goals as concentric rings, or one value on a gauge with a target tick, built on the free chart core.

## When to use

- A few goals tracked side by side, each against its own total: quotas by segment, budgets by team, storage by plan.
- One score on a known scale with a line to clear: uptime against an SLO, a health score, a satisfaction target.
- A card where seeing a fill grow or shrink with a range control is the point.

## When not to use

- Parts of one total: use a [Donut Chart](/components/donut-chart), whose slices add up to the whole.
- More than five goals, or goals you need to compare precisely: use a [Bar Chart](/components/bar-chart); lengths on one axis compare better than arcs at different radii.
- One number with no scale: use a [Stat Tile](/components/stat-tile). A single progress bar in a form or upload: use [Progress](/components/progress).

## Usage

```tsx example.tsx
import { RadialChart } from "@/components/eased/radial-chart/radial-chart";

const usd = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", notation: "compact", maximumSignificantDigits: 3 });

export function Example() {
  return (
    <RadialChart
      data={[
        { key: "new", label: "New business", value: 418000, max: 1200000 },
        { key: "expansion", label: "Expansion", value: 171200, max: 450000 },
        { key: "renewals", label: "Renewals", value: 597000, max: 1600000 },
      ]}
      label="Quota attainment, Q4 to date"
      format={(v) => usd.format(v)}
    />
  );
}
```

## Examples

### Gauge with a target

One series on an open sweep. `min` and `max` set the scale and label the two ends; `target` draws a tick across the ring and the centre reads it.

```tsx
<RadialChart
  data={[{ key: "uptime", label: "API uptime", value: 99.86, target: 99.9 }]}
  label="API uptime, Q4 to date"
  sweep={240}
  min={99}
  max={100}
  height={168}
  format={(v) => `${v}%`}
/>
```

Colour the fill by state yourself when it means something: `color: value < target ? "var(--eased-warning)" : undefined`. The fill fades to the new colour over 150ms as it morphs.

### Morphing with a range

Give each ring a stable `key`. Under a `ChartRangeProvider`, every chart on the page morphs on the same beat when the range changes, and target ticks glide with the fills.

```tsx
import { ChartRangeProvider } from "@/components/eased/_primitives/chart-core/range";

<ChartRangeProvider value={quarter}>
  <RadialChart data={quotas[quarter]} label={`Quota attainment, ${quarter}`} format={usd.format} />
</ChartRangeProvider>
```

## API reference

### RadialChart

| Prop | Type | Default | Description |
|---|---|---|---|
| `data` | `{ key, label, value, max?, target?, color? }[]` | | One ring per series, outermost first. `max` is what a full ring stands for (the chart's `max` if left out); `target` draws a tick at that value. |
| `label` | `string` | | Names the figure, the slider and the hidden table. |
| `sweep` | `number` | `360` | Degrees each ring sweeps, 180 to 360 (values outside are clamped, with a warning in development). A full ring starts at 12 o'clock; an open one is centred on it, open at the bottom. |
| `min` | `number` | `0` | The value at the start of every ring. |
| `max` | `number` | `100` | The value at the end of every ring, unless a series sets its own. |
| `height` | `number` | `240` | The plot; the legend sits above. |
| `format` | `(value: number) => string` | | Values in the centre, the scale and screen reader text. |
| `legend` | `boolean` | on for 2+ rings | Keys toggle rings; hovering or focusing one picks its ring. |
| `defaultHidden` | `string[]` | | Ring keys hidden at first. At least one ring stays on. |
| `onActiveChange` | `(series \| null) => void` | | The hovered, focused or tapped ring. |
| `className` | `string` | `""` | Appended to the root's classes. |

Fills stop at the end of the sweep: a value over its `max` closes the ring, and the centre and table carry the true number. The centre reads the active ring, else the first one; when the hole is too small to hold a value, the legend's trailing edge reads it instead. An open sweep labels its ends with `min` and `max` when every ring shares them.

Each ring keeps the colour it first appeared in, `chartColor(1…6)` by position. Pass `color` to choose one.

## Keyboard

| Key | Action |
|---|---|
| `Tab` | Focuses the chart and picks the first ring. |
| `→` / `↑` | Next ring, inward. |
| `←` / `↓` | Previous ring. |
| `Home` / `End` | Outermost or innermost ring. |
| `Escape` | Back to the first ring, nothing picked. |

## Accessibility

- The chart is one `role="slider"` named by `label`. Its `aria-valuetext` reads the picked ring's name, value, total and target, so arrowing across rings announces each one; with none picked it reads how many rings there are.
- A visually hidden `<table>` lists every ring's value, total and target; the SVG, the centre and the scale are `aria-hidden`.
- Identity never rests on colour: two or more rings get a legend, and slots 3 to 6 of the palette sit under 3:1 on a white surface.
- Pointer: a ring is picked anywhere on its track, filled or not. Touch: a tap picks the ring under it and keeps it until the next tap; the page still scrolls over the chart.

## Motion

Fills sweep in from the start of the ring once, the first time the chart scrolls into view (0.9s, ease in-out), while the centre counts up from zero; tracks and target ticks are there from the first frame, so the fill visibly travels toward its mark. A new dataset morphs every fill's end and every target from what is on screen on the chart transition (`smooth`, no overshoot, shared through `ChartRangeContext`); a ring that appears grows out of its start, one that leaves closes into it, and the others slide to their new radii on the same transition. The picked ring thickens 1.5px on each side on `snappy`, because pointing is direct feedback and has to land within a beat; the others dim over 150ms. The centre's name swaps and its number rolls in the direction of change. Reduced motion: no sweep, no morph, no thickening travel; dimming stays.

## Notes for AI

Pick Radial Chart for progress toward goals: a handful of rings with their own `max` (quotas, budgets), or one series with `sweep={240}`, `min`, `max` and `target` for a gauge. Pass stable `key`s, `format` for the units, and keep rings to five or fewer so each stays thick enough to read.

Do not use it for parts of a whole (use Donut Chart), do not sort the rings per range (they would trade radii instead of morphing), and do not build a separate legend, centre label or tooltip; they are built in. Do not wrap it in another slider or `role="img"`; the chart already is the accessible control.

## Related

- [Donut Chart](/components/donut-chart): shares of one total, on the same arc engine.
- [Progress](/components/progress): one linear bar inside a form or task.
- [Stat Tile](/components/stat-tile): one number with its trend, when no scale is needed.
