# Radar Chart (/docs/charts/components/radar)

Use a radar chart to compare two or three profiles, like products or teams, across five to eight measures on one shared scale. Each measure is a spoke, and each profile is a polygon.

<Example caption="Hover a spoke to compare both scores. Press a polygon or a legend item to highlight that product.">
<Basic />

```tsx
"use client";

import { RadarChart, type SeriesConfig } from "@kind-ui/charts";

const config = {
  studio: { label: "Studio", color: "#733bff" },
  field: { label: "Field", color: "#008b82" },
} satisfies SeriesConfig;

const data = [
  { trait: "Speed", studio: 88, field: 62 },
  { trait: "Quality", studio: 76, field: 91 },
  { trait: "Value", studio: 63, field: 84 },
  { trait: "Support", studio: 92, field: 68 },
  { trait: "Reach", studio: 58, field: 89 },
  { trait: "Trust", studio: 81, field: 74 },
];

export default function ProductRadarChart() {
  return (
    <RadarChart
      config={config}
      data={data}
      height={300}
      animate
      outerRadius="68%"
      interaction={{ kind: "series", eligibleKeys: Object.keys(config) }}
      aria-label="Product research scores out of 100"
    >
      <RadarChart.Grid radialLines={false} />
      <RadarChart.AngleAxis dataKey="trait" />
      <RadarChart.RadiusAxis
        domain={[0, 100]}
        ticks={[25, 50, 75, 100]}
        angle={60}
        axisLine={false}
        tick={{ fontSize: 10 }}
      />
      <RadarChart.Series dataKey="studio" strokeWidth={2} fillOpacity={0.18} />
      <RadarChart.Series dataKey="field" strokeWidth={2} fillOpacity={0.18} />
      <RadarChart.Tooltip />
      <RadarChart.Legend />
    </RadarChart>
  );
}
```
</Example>

## Installation [#installation]

```bash tab="shadcn"
npx shadcn@latest add @kind-ui/radar-chart
```

```bash tab="npm"
npm install @kind-ui/charts motion recharts
```

## Composition [#composition]

```text
RadarChart
├── RadarChart.Grid
├── RadarChart.AngleAxis
├── RadarChart.RadiusAxis
├── RadarChart.Series
├── RadarChart.Tooltip
├── RadarChart.Legend
└── RadarChart.Content
```

`RadarChart` holds the data, the series config and the accessible name, and draws only the parts you add. `RadarChart.AngleAxis` names the spokes from a row field, `RadarChart.RadiusAxis` sets the scale out from the center, and `RadarChart.Grid` draws the rings behind them. Add one `RadarChart.Series` per profile. `RadarChart.Content` places your own HTML next to the legend.

## Usage [#usage]

### Scale [#scale]

Each row is a spoke, and every profile reads its value from the same row. Give `RadarChart.RadiusAxis` a fixed `domain`, like `[0, 100]`, and explicit `ticks`, so every spoke uses the same scale. Only compare measures with the same unit. Set `outerRadius` on the chart (the example uses `"68%"`) to leave room for the spoke names.

Overlapping profiles need a see-through fill: set `fillOpacity` on each series, like `0.18`. `RadarChart.Grid` takes `radialLines={false}` to hide the spokes and keep the rings.

### Selection and Keyboard [#selection-and-keyboard]

With `interaction={{ kind: "series", eligibleKeys }}`, pressing a polygon or its legend item highlights that profile and dims the others, and screen readers hear "Highlighted Studio." Press it again, or press Escape, to clear it. Each profile is a button, so Tab reaches it and Enter or Space presses it.

Pass `selected` and `onSelectionChange` in `interaction` to control the highlight yourself. To hide and show profiles from the legend instead, see [Legend](../building-blocks/legend.mdx).

Focus the chart and press the arrow keys to move between spokes, which shows every profile's score in the tooltip, and Escape to dismiss it.

### Materials [#materials]

Set `material="clay"` or `"glow"` on a series for a finish. The glow spreads past the polygon's edge, so it doesn't mark a score. See [Materials](../guides/materials.mdx).

### Motion [#motion]

With `animate`, the polygons grow out from the center when the chart mounts. Pass `animate={{ revealDurationMs: 800 }}` to change its length. When the reader prefers reduced motion, the polygons appear without growing. See [Motion](../guides/motion.mdx).

### Loading [#loading]

Set `loading` while the data is on its way. The chart keeps its size and shows a placeholder polygon that slowly changes shape, or holds still when the reader prefers reduced motion. Screen readers hear `loadingLabel` ("Loading chart" by default).

## API Reference [#api-reference]

### RadarChart [#radarchart]

### RadarChartOptions

| Prop                     | Type                                                                                                                                                                                                                                                 | Description                                                                                                                               |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `visibleSeries?`         | `readonly string[] \| undefined`                                                                                                                                                                                                                     | The series keys to show, when you control visibility.                                                                                     |
| `defaultVisibleSeries?`  | `readonly string[] \| undefined`                                                                                                                                                                                                                     | The series keys to show first, when the chart controls visibility.                                                                        |
| `onVisibleSeriesChange?` | `((next: string[]) => void) \| ((next: string[]) => void) \| undefined`                                                                                                                                                                              | Called with the next visible series keys when the legend hides or shows one.                                                              |
| `config`                 | `Readonly<Record<string, { label?: string; color: SeriesColor; pattern?: FillPattern; icon?: React.ComponentType; legendShape?: NonNullable<React.ComponentProps<typeof Symbols>["type"]>; formatValue?: (value: ValueType) => React.ReactNode; }>>` | The label, color and value format of each series, keyed by its `dataKey` or `seriesKey`.                                                  |
| `emphasis?`              | `"auto" \| "none"`                                                                                                                                                                                                                                   | Dims the other series while one is hovered or focused. `"none"` turns it off. Default: `"auto"`                                           |
| `interaction?`           | `ChartInteractionConfig \| undefined`                                                                                                                                                                                                                | What pressing a legend item does: highlight a series (the default) or hide and show it.                                                   |
| `aria-label?`            | `string \| undefined`                                                                                                                                                                                                                                | The chart's accessible name. Pass this or `aria-labelledby`.                                                                              |
| `aria-labelledby?`       | `string \| undefined`                                                                                                                                                                                                                                | The id of an element that names the chart. Pass this or `aria-label`.                                                                     |
| `legendPosition?`        | `"bottom" \| "top"`                                                                                                                                                                                                                                  | Places the legend and other HTML parts above or below the plot. Default: `"bottom"`                                                       |
| `frameProps?`            | `` (Omit<ChartProviderProps, "children" \| "config" \| "defaultVisibleSeries" \| "emphasis" \| "interaction" \| "nonce" \| "onVisibleSeriesChange" \| "visibleSeries"> & { [key: `data-${string}`]: unknown; }) \| undefined ``                      | Attributes, handlers and ref for the outer HTML frame. Plot props remain on the chart.                                                    |
| `animate?`               | `boolean \| BaseAnimation \| undefined`                                                                                                                                                                                                              | Grows the polygons out from the center on mount. Pass options to change the duration or easing. Reduced motion skips it. Default: `false` |
| `loading?`               | `boolean \| undefined`                                                                                                                                                                                                                               | Shows a placeholder plot and hides the legend and tooltip while the data is on its way.                                                   |
| `loadingLabel?`          | `string \| undefined`                                                                                                                                                                                                                                | What screen readers hear while `loading` is on. Default: `"Loading chart"`                                                                |

### RadarChart.Series [#radarchartseries]

### RadarSeriesOptions

| Prop         | Type                          | Description                                                                                                            |
| ------------ | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `seriesKey?` | `string \| undefined`         | The series' `config` key. Defaults to `dataKey` when it's a string; required for a function `dataKey` with visibility. |
| `material?`  | `"clay" \| "glow" \| "plain"` | A `"clay"` or `"glow"` finish on the default marks. Custom shapes keep their own paint.                                |

<Caption>
`RadarChart` and `RadarChart.Series` also take every prop of Recharts' [RadarChart](https://recharts.github.io/en-US/api/RadarChart/) and [Radar](https://recharts.github.io/en-US/api/Radar/), like `outerRadius`, `fillOpacity` and `dot`.
</Caption>