# Radar Chart

Radar chart for comparing profiles across several measures, on a polygon or circular grid.

- Category: Charts
- Page: https://wunderui.com/components/radar-chart
- Tier: Core and Pro

## Install

Radar Chart ships with WunderUI Core and Pro in the @wunderui/react package.

## Import

```tsx
import { RadarChart, RadarChartProps, RadarChartVariant } from "@wunderui/react"
```

## Minimal usage

Then use it:

```tsx
import { RadarChart } from "@wunderui/react/charts"

const data = [
  { metric: "Speed", a: 86 },
  { metric: "Quality", a: 74 },
  { metric: "Support", a: 60 },
  { metric: "Price", a: 55 },
  { metric: "Docs", a: 70 },
]

export function ProductScores() {
  return <RadarChart data={data} index="metric" series={[{ key: "a", label: "Team A" }]} label="Product scores" />
}
```

Expected result: You should see one polygon over a five-sided grid with the five measures at its corners.

## When to use

### Use Radar Chart for

- A profile across several measures, where the overall shape matters (skills, quality scores)
- Comparing two or three profiles on the same axes
- Five to ten axes that share one scale

### Use something else

- [Bar Chart](https://wunderui.com/components/bar-chart) for exact comparison of a few values
- [Slope Chart](https://wunderui.com/components/slope-chart) for change between two points, and parallel coordinates
- [Radial Chart](https://wunderui.com/components/radial-chart) for progress against a goal
- [Bullet Chart](https://wunderui.com/components/bullet-chart) for a measure against a target

## Keyboard

The plot is focusable: Arrow keys move from axis to axis and the live region reads each series value, such as Speed: Team A 60, Team B 50. Series switched off in the legend are marked hidden.

| Key | Action |
|---|---|
| `Tab` or `Shift+Tab` | Moves focus to the plot and away from it. The plot is one tab stop; so is every legend badge. |
| `ArrowRight` or `ArrowLeft` | Moves to the next or previous axis. The tooltip follows, and a live region announces the one you are on. The first press starts at the first one (Left: the last one). |
| `Home` or `End` | Jumps to the first or last axis. |
| `Escape` | Clears the active point. |
| `Enter` or `Space` | On a legend badge of a ChartCard: switches its series off or on. The last visible series stays on. |

## Behavior

What the chart does on its own and what the page decides.

- **Axes and polygons:** Each data row is an axis and each series entry a polygon. The index names the field with the axis name.
- **Scale:** The max sets the top of the scale and defaults to a round maximum of the data. All axes share it, so keep the measures in one unit.
- **Grid and fill:** The variant picks the grid (a polygon, or circles on the circular variant), the fill and whether points show.
- **Empty:** The chart counts as empty when there are no data rows or the first series holds no numbers.
- **Tooltip:** The tooltip takes its form from the chart's own width, like Area, Line and Bar: under 360 px it docks over the top of the chart at its full width, under 560 px it is the compact card, above that the standard card that follows the pointer.
- **Loading, empty and error:** The chart keeps its size while loading, empty or failed, so the card never changes height. Add a retry handler to show a Try again button on error.
- **Legend:** In a ChartCard, each series badge is a button that switches its series off, but the last visible series stays on. A legend of roles can be made static.
- **Data table:** The chart renders its data as a table for screen readers, in the same order as the plot.
- **Size:** The chart fills the width of its container and you set the plot height. Text never scales, so labels keep their size at every width.

## Motion

The enter sequence and the hover follow the motion tokens of the library.

- **Grid and polygons:** The rings grow out of the centre one after another, the spokes extend, then the polygons unfold from the centre without turning and the labels fade in. It plays on first view, after loading and when new data arrives, and can be turned off.
- **Hover:** Hovering an axis highlights it and the series points glide to it. The series nearest the pointer keeps its strength, the others dim.
- **Reduced motion:** With reduced motion on, the chart appears at once without the enter sequence. The tooltip and every state still work.

## Anatomy

- `RadarChart`: Pass data with one row per axis, the field for the axis name and the series for the polygons. The max sets the top of the scale and the variant sets the grid and fill.
- `Plot`: The focusable region. Arrow keys walk its marks and the live region reads each one the way the tooltip shows it.
- `Marks`: The grid (a polygon, or circles on the circular variant) with the ring values on the top spoke, the axis labels and one polygon per series. Hovering an axis highlights it and the series points glide to it; with several series the one nearest the pointer stays and the others dim. Axis labels that would touch fall back to the hovered one.
- `Tooltip`: The axis name with one row per visible series in its colour.
- `Loading, empty and error`: A muted hexagon under the shimmer. The chart counts as empty when there are no data rows or the first series holds no numbers.
- `Data table and live region`: A table with one row per axis and a column per series.
- `Chart Grid`
- `Chart Scale`
- `Chart Axis Labels`

## Best practices

### When to use

- Use RadarChart to compare profiles across five to eight shared measures, such as plan fit or team skills. Use BarChart when readers need to compare single values accurately.

### Do

- Keep the same scale on every axis, with the same unit or a normalized 0 to 100 score. A radar mixes axes visually, so unequal scales distort the shape.
- Limit to two or three series, and use the dots or outline variants when they overlap. Filled polygons hide each other.
- Fix the axis order, with related measures next to each other. The shape changes with the order, so keep it the same across charts that are compared.

### Don't

- Don't use fewer than four axes. Three give a triangle that a bar chart shows better, and the area is not meaningful.
- Don't read polygon area as a total. It depends on the axis order, so use the tooltip or the table for the comparison.

## API reference

### RadarChart

| Prop | Type | Default | Description |
|---|---|---|---|
| data* | readonly ChartDatum[] |  | One object per slice / ring / axis. |
| index* | string |  | Field holding the label. |
| series* | readonly ChartSeries[] |  | One polygon per series; each row of `data` is an axis. |
| activeIndex | number \| null |  | The active point (hovered or focused) as an index into `data`, to control it yourself. `null` shows none. |
| animate | boolean |  |  |
| animationKey | string \| number |  |  |
| className | string |  | Extra classes for the root element of the chart. |
| defaultActiveIndex | number \| null |  | The point that is active at first, for an uncontrolled chart. It shows the tooltip without a pointer. |
| description | string |  |  |
| emptyDescription | string |  | Text under the title in the empty state. |
| emptyTitle | string |  | Title of the message in the empty state. |
| errorDescription | string |  | Text under the title in the error state. |
| errorTitle | string |  | Title of the message in the error state. |
| height | number |  | Height of the plot frame in px. Default 280 (Figma small card plot). |
| hiddenSeries | readonly string[] |  | Labels of rows switched off in the legend: drawn faded. |
| label | string |  | Accessible name, e.g. the card title. |
| max | number |  | Top of the scale (default: a nice maximum of the data). |
| onActiveIndexChange | (index: number \| null) => void |  | Called with the index when the pointer or the arrow keys move to another point, and with `null` when they leave. Use it to show the hovered value in a headline. |
| onRetry | () => void |  | Shows a Try again button in the error state and calls this when it is pressed. |
| scaleLabels | boolean | true | Shows the value of each grid ring along the top spoke. Hidden on its own when the rings sit too close for a label. |
| state | "ready" \| "loading" \| "empty" \| "error" |  |  |
| tooltip | boolean |  |  |
| valueFormatter | ChartValueFormatter |  |  |
| variant | "basic-radar" \| "filled-radar" \| "multi-series-radar" \| "circular-radar" \| "radar-with-dots" | "filled-radar" | Figma variant. Default `filled-radar`. |
| width | number |  |  |

## Examples

### States

### Ring values and series highlight

## In context

### Skills Comparison

Competencies against the level expectation.

### Product Comparison

Satisfaction by area for three products; the legend switches products off.

### Player Stats

Attribute percentiles with KPI cards.

## For AI agents

`get_component("radar-chart")`

Hand your agent this page as Markdown or the WunderUI MCP server, not a screenshot.
