Examples

Team skills

Preview
Team skills (0–5)Radar chart of 2 series across 6 measures, scale 0 to 5.
  • Platform team
  • Mobile team
Use the arrow keys to move between data points, Home and End to jump to the first and last.
Example.tsx
import { RadarChart } from '@reactloom/charts';

const skills = ['Design', 'Frontend', 'Backend', 'Data', 'Testing', 'Ops'].map((area, i) => ({ area, platform: [4, 5, 3, 2, 4, 3][i] ?? 0, mobile: [5, 4, 2, 1, 3, 2][i] ?? 0 }));

export default function Example() {
  return <RadarChart title="Team skills (0–5)" data={skills} category="area" max={5} series={[{ key: 'platform', label: 'Platform team' }, { key: 'mobile', label: 'Mobile team' }]} />;
}

Products compared

Preview
Reviews compared (out of 10)Radar chart of 2 series across 5 measures, scale 0 to 10.
  • Our phone
  • Rival
Use the arrow keys to move between data points, Home and End to jump to the first and last.
Reviews compared (out of 10) (data)
CategoryOur phoneRival
Price78
Battery96
Camera68
Screen87
Support95
Example.tsx
import { RadarChart } from '@reactloom/charts';

const scores = [
  { attribute: 'Price', ours: 7, rival: 8 },
  { attribute: 'Battery', ours: 9, rival: 6 },
  { attribute: 'Camera', ours: 6, rival: 8 },
  { attribute: 'Screen', ours: 8, rival: 7 },
  { attribute: 'Support', ours: 9, rival: 5 },
];

export default function Example() {
  return <RadarChart title="Reviews compared (out of 10)" data={scores} category="attribute" max={10} series={[{ key: 'ours', label: 'Our phone' }, { key: 'rival', label: 'Rival' }]} table="visible" />;
}

API reference

RadarChart props
PropTypeDefault
datarequired
Row[]—
categoryrequired
The spoke of each row.
key or accessor—
seriesrequired
{ key, label, value?, color? }[]—
max
Scale maximum.
number—
titlerequired
Names the figure.
string—
description
The takeaway; a factual summary is generated when omitted.
ReactNode—
table
The data table alternative.
'toggle' | 'visible' | 'none''toggle'
height · valueFormat · formatValue · messages
As on the other charts.
—

Customization

Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.

State attributes

Target these in your CSS to style states without depending on class names.

AttributeValues
[data-active]present when on

Theme tokens it reads

--pl-color-border-default --pl-color-fg-default --pl-color-fg-muted

Accessibility

  • The chart is a figure named by its title and described by a summary; the drawing is hidden from assistive technology.
  • The plot is one tab stop: arrow keys move between items and each is announced; the data table gives every value.
  • Each spoke reads every series' value.
Keyboard interactions
KeyAction
TabFocus the plot
← → ↑ ↓Move between items
Home / EndFirst / last item
EscapeClear the highlight

Usage guidelines

Do

  • Keep to a few series and a shared scale.

Don’t

  • Don't read area as meaningful: spoke order changes it.