Radial Chart
Draw values as concentric rings, for progress toward a goal or a short ranked list.
Overview
A radial chart draws each row as a ring whose length is its value. It works best for progress toward a known maximum, such as activity goals or storage used, and for short ranked lists where a compact, round shape suits a dashboard tile. Outer rings are longer than inner rings at the same value, so use a bar chart when readers must compare values precisely, and a Gauge Chart for a single value with ranges.
Anatomy
RadialChart owns the data, scale, ring geometry, selection, and loading state. Each row is one ring, named by nameKey; the first row is the outermost. Bar draws a series, with a muted track behind it. Add several Bar parts with one stackId to split a ring into segments. Center puts an HTML readout in the hole, Label names each ring, and Legend and Tooltip add context.
Accessibility
The plot has an accessible name listing the series and rings; pass ariaLabel to describe the finding instead. Text in Center is real text drawn over the canvas, so it stays crisp at any zoom, but it is decorative to assistive technology, so keep the same information in the accessible name or nearby text. The tooltip and ring selection are pointer-operated.
Installation
Usage
import { RadialChart, type ChartConfig } from "honestui/charts";<RadialChart data={data} dataKey="visitors" nameKey="browser" config={chartConfig}>
<RadialChart.Bar isClickable />
<RadialChart.Center label="Visitors" />
<RadialChart.Legend isClickable />
<RadialChart.Tooltip />
</RadialChart>With one series, each ring takes the color of its row's config entry, like a pie sector. With several series, colors come from each Bar's dataKey. Set max when values are a share of a known total; without it the longest ring closes the circle. startAngle and endAngle follow ECharts: degrees, 0 at 3 o'clock, counterclockwise positive. A partial sweep is fitted to its own bounds, so a half circle fills the width it is given.
Examples
Progress rings
Set max to the goal so each ring shows progress toward it. The Center shows its own value at rest and the hovered ring's value on hover.
Stacked half circle
Give several Bar parts one stackId to split a single ring. Segments are parted by a background-colored edge.
Ring labels
Label writes each ring's name just before its start. Pair it with a partial sweep, such as endAngle={-180}, so the names have an open quarter to sit in.