RadialChart
Shows several progress values as rings around one centre.
SourcePackage @weft-js/warp
Preview
tsx
import { RadialChart } from '@weft-js/warp'export function Goals() { return ( <RadialChart title="Q4 goals" description="Share of each target reached" data={GOALS} /> )}const GOALS = [ { name: 'Deploys under 3 min', value: 0.86 }, { name: 'Uptime target', value: 0.74 }, { name: 'Teams on CI', value: 0.58 }, { name: 'Docs coverage', value: 0.37 },]const min = 60_000Installation
npm install @weft-js/warpUsage
tsx
import { RadialChart } from '@weft-js/warp'<RadialChart title="Q4 goals" description="Share of each target reached" data={GOALS} />Accessibility
- Every chart has a text alternative and a table view of its numbers, so nothing depends on seeing the marks. See Chart for its keyboard support.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | — | The heading. |
level | 2 | 3 | 4 | 6 | 5 | — | The title's heading level: one below the heading the chart sits under. Default 3, a chart in a page section. |
description | unknown | — | One supporting line under the title. |
toolbar | unknown | — | Beside the view toggle: a layout switch, a range picker. |
state | "error" | "loading" | "empty" | — | Replaces the plot, in the same frame. With no data the frame shows empty on its own. |
loading | string | — | Shows that work is under way. |
empty | { title: string; detail?: unknown; } | — | The title and detail shown in place of the plot when there is no data. |
error | { title: string; detail?: unknown; } | — | A message that marks the field invalid and says why. |
action | unknown | — | The next step under an empty or error state: a Retry button. |
data | { name: string; value: number; }[] | — | The series to draw. |
summary | string | ((c: { data: { name: string; value: number; }[]; title: string;… | — | One sentence for screen readers and the page; generated from the data when absent. |
RelatedGauge chartDonut chart