# Radar chart

A few items scored on the same axes, as overlapping polygons.

- Family: charts
- Import: `import { RadarChart } from "@senvenli/react/charts";`
- Page: https://design.senvenli.com/docs/components/radar-chart
- JSON: https://design.senvenli.com/docs/components/radar-chart.json

## Example: Two profiles

One supplier against the average, on the same six measures.

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

const SCORES = [
  { measure: "Quality", supplier: 8.6, average: 7.1 },
  { measure: "Delivery", supplier: 7.2, average: 7.4 },
  { measure: "Price", supplier: 6.1, average: 6.8 },
  { measure: "Support", supplier: 9.0, average: 6.5 },
  { measure: "Flexibility", supplier: 7.8, average: 6.2 },
  { measure: "Sustainability", supplier: 8.1, average: 5.9 },
];

export default function Example() {
  return (
    <RadarChart
      title="Supplier scorecard"
      period="2026 review"
      data={SCORES}
      dimension="measure"
      categories={["supplier", "average"]}
      labels={{ supplier: "Northwind Paper", average: "Supplier average" }}
      max={10}
    />
  );
}
```

## Examples

### One profile

A single shape, for strengths and gaps at a glance.

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

const SATISFACTION = [
  { area: "Checkout", score: 88 },
  { area: "Delivery", score: 74 },
  { area: "Product quality", score: 91 },
  { area: "Support", score: 67 },
  { area: "Returns", score: 59 },
];
const percent = new Intl.NumberFormat("en", { style: "percent" });

export default function Example() {
  return (
    <RadarChart
      title="Customer satisfaction"
      period="Q1 2026 survey"
      data={SATISFACTION}
      dimension="area"
      categories={["score"]}
      labels={{ score: "Satisfied customers" }}
      max={100}
      valueFormatter={(value) => percent.format(value / 100)}
    />
  );
}
```

## Guidelines

### When to use it

- Comparing two or three profiles on five to eight measures.

### Use something else when

- [bar-chart](https://design.senvenli.com/docs/components/bar-chart.md): Precise comparison matters more than shape.

## Accessibility

Built in:

- A "Show as table" button shows the same data as a table, which screen readers get by default.

You provide:

- A title that says what the figure is.

## API reference

### RadarChart

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| title | `string` |  | no | What the chart shows, over it; leave it out when a card or a heading already says so. |
| aria-label | `string` |  | no | Names the chart when it has no visible `title` (a card's heading already says what it shows). |
| period | `string` |  | no |  |
| isLoading | `boolean` |  | no |  |
| emptyState | `React.ReactNode` |  | no | Shown instead of the plot when there is no data: an `EmptyState size="small"` or text; "No data" by default. |
| height | `number` | `280` | no |  |
| data | `readonly T[]` |  | yes | One row per dimension (five to eight). |
| dimension | `keyof T & string` |  | yes | The dimension's name key. |
| categories | `readonly (keyof T & string)[]` |  | yes | One or two profiles: the first is the main one, a second is the comparison. |
| labels | `Readonly<Partial<Record<string, string>>>` |  | no |  |
| max | `number` |  | yes | The shared scale's top. |
| valueFormatter | `ChartValueFormatter` | `plain` | no |  |

### Tokens it reads

`--ds-background-neutral`, `--ds-background-neutral-pressed`, `--ds-border`, `--ds-border-bold`, `--ds-border-focused`, `--ds-chart-1`, `--ds-chart-2`, `--ds-chart-3`, `--ds-chart-4`, `--ds-chart-5`, `--ds-chart-neutral`, `--ds-link`, `--ds-radius-medium`, `--ds-radius-small`, `--ds-radius-xsmall`, `--ds-shadow-overlay`, `--ds-space-050`, `--ds-space-075`, `--ds-space-100`, `--ds-space-150`, `--ds-space-200`, `--ds-space-300`, `--ds-space-400`, `--ds-surface-overlay`, `--ds-surface-raised`, `--ds-text`, `--ds-text-danger`, `--ds-text-subtle`, `--ds-text-subtlest`, `--ds-text-success`

## Related

- [bar-chart](https://design.senvenli.com/docs/components/bar-chart.md)
