# Radar Chart

> Compare a few series across several measures that share one scale.

Source: https://www.honestui.com/docs/charts/radar-chart/static

### Basic Chart

```tsx
"use client";

import { RadarChart, type ChartConfig } from "honestui/charts";

// Scenario: Two laptops compared across review scores
const data = [
  { metric: "Performance", studio: 92, air: 74 },
  { metric: "Battery", studio: 68, air: 90 },
  { metric: "Display", studio: 88, air: 76 },
  { metric: "Portability", studio: 54, air: 94 },
  { metric: "Thermals", studio: 80, air: 62 },
  { metric: "Value", studio: 60, air: 84 },
];

const chartConfig = {
  studio: {
    label: "Studio 16",
    colors: { light: ["#3b82f6"], dark: ["#60a5fa"] },
  },
  air: {
    label: "Air 13",
    colors: { light: ["#10b981"], dark: ["#34d399"] },
  },
} satisfies ChartConfig;

export function ExampleRadarChart() {
  return (
    <RadarChart className="h-full w-full p-4" data={data} nameKey="metric" config={chartConfig} max={100}>
      <RadarChart.Grid />
      <RadarChart.Axis />
      <RadarChart.Legend isClickable />
      <RadarChart.Tooltip />
      <RadarChart.Radar dataKey="studio" />
      <RadarChart.Radar dataKey="air" />
    </RadarChart>
  );
}

```

## Overview [#overview]

Use a radar chart to compare the overall shape of one to three series across five to eight measures that share one scale, such as review scores or a skills profile against a target. The shape makes strengths and gaps visible at a glance. Use a bar chart when readers need to compare exact values, when measures use different units, or when there are many series, because overlapping areas become hard to separate.

## Anatomy [#anatomy]

`RadarChart` owns the data, scale, selection, and loading state. Each row in `data` is one measure (one spoke), named by `nameKey`. Each `Radar` part draws one series from a numeric field. `Grid` draws the rings and spokes, `Axis` labels the spokes, and optional `Legend` and `Tooltip` parts add context.

## Accessibility [#accessibility]

The plot is a canvas with an accessible name that lists the series and measures; pass `ariaLabel` to describe the finding instead. Pair the chart with a table or a short summary when exact values matter. The tooltip compares every series on the spoke nearest the pointer, but it is pointer-operated, so do not make it the only way to read a value. Keep series colors distinct and labelled in the legend, and prefer a dashed `lines` variant for a reference profile so it does not rely on color alone.

## Installation [#installation]

<CommandBlock commands="[&#x22;honestui&#x22;]" />

## Usage [#usage]

```tsx
import { RadarChart, type ChartConfig } from "honestui/charts";
```

```tsx
const data = [
  { metric: "Performance", studio: 92, air: 74 },
  { metric: "Battery", studio: 68, air: 90 },
  { metric: "Display", studio: 88, air: 76 },
];

const chartConfig = {
  studio: { label: "Studio 16", colors: { light: ["#3b82f6"], dark: ["#60a5fa"] } },
  air: { label: "Air 13", colors: { light: ["#10b981"], dark: ["#34d399"] } },
} satisfies ChartConfig;
```

```tsx
<RadarChart data={data} nameKey="metric" config={chartConfig} max={100}>
  <RadarChart.Grid />
  <RadarChart.Axis />
  <RadarChart.Legend isClickable />
  <RadarChart.Tooltip />
  <RadarChart.Radar dataKey="studio" />
  <RadarChart.Radar dataKey="air" />
</RadarChart>
```

Every spoke shares one scale from `min` to `max`. Without `max`, the chart rounds the largest value up so each ring lands on a readable number. Spokes read clockwise from 12 o'clock in data order.

## Examples [#examples]

### Circle grid [#circle-grid]

### shape=&#x22;circle&#x22; variant=&#x22;filled&#x22;

```tsx
"use client";

import { RadarChart, type ChartConfig } from "honestui/charts";

// Scenario: Weekly focus hours by area
const data = [
  { area: "Deep work", hours: 18 },
  { area: "Meetings", hours: 9 },
  { area: "Reviews", hours: 6 },
  { area: "Planning", hours: 4 },
  { area: "Support", hours: 7 },
  { area: "Learning", hours: 5 },
  { area: "Admin", hours: 3 },
];

const chartConfig = {
  hours: {
    label: "Hours",
    colors: { light: ["#8b5cf6"], dark: ["#a78bfa"] },
  },
} satisfies ChartConfig;

export function ExampleRadarChart() {
  return (
    <RadarChart className="h-full w-full p-4" data={data} nameKey="area" config={chartConfig}>
      <RadarChart.Grid
        shape="circle" // [!code highlight]
        variant="filled" // [!code highlight]
      />
      <RadarChart.Axis showValues />
      <RadarChart.Tooltip valueFormatter={(value) => `${value} h`} />
      <RadarChart.Radar dataKey="hours" dot="border" />
    </RadarChart>
  );
}

```

> 
  
    Set the `Grid` `shape` to `"circle"` for round rings, and `variant="filled"` for alternating ring bands. `showValues` on `Axis` labels the rings along the first spoke.
  


### Reference profile [#reference-profile]

### variant=&#x22;lines&#x22; dashed

```tsx
"use client";

import { RadarChart, type ChartConfig } from "honestui/charts";

// Scenario: Candidate skills against the role's target profile
const data = [
  { skill: "System design", target: 4, candidate: 5 },
  { skill: "Testing", target: 4, candidate: 3 },
  { skill: "Communication", target: 5, candidate: 4 },
  { skill: "Ownership", target: 4, candidate: 5 },
  { skill: "Mentoring", target: 3, candidate: 2 },
];

const chartConfig = {
  target: {
    label: "Role target",
    colors: { light: ["#6b7280"], dark: ["#9ca3af"] },
  },
  candidate: {
    label: "Candidate",
    colors: { light: ["#f59e0b"], dark: ["#fbbf24"] },
  },
} satisfies ChartConfig;

export function ExampleRadarChart() {
  return (
    <RadarChart className="h-full w-full p-4" data={data} nameKey="skill" config={chartConfig} max={5}>
      <RadarChart.Grid rings={5} />
      <RadarChart.Axis />
      <RadarChart.Legend />
      <RadarChart.Tooltip valueFormatter={(value) => `${value} / 5`} />
      <RadarChart.Radar
        dataKey="target"
        variant="lines" // [!code highlight]
        dashed // [!code highlight]
      />
      <RadarChart.Radar dataKey="candidate" dot="default" />
    </RadarChart>
  );
}

```

> 
  
    Draw a target or benchmark with `variant="lines"` and `dashed`, so the filled series reads against it. `dot` adds a point at each vertex.
  


### Loading state [#loading-state]

### isLoading

```tsx
"use client";

import { RadarChart, type ChartConfig } from "honestui/charts";

const chartConfig = {
  score: {
    label: "Score",
    colors: { light: ["#3b82f6"], dark: ["#60a5fa"] },
  },
} satisfies ChartConfig;

export function ExampleRadarChart() {
  return (
    <RadarChart
      className="h-full w-full p-4"
      data={[]}
      nameKey="metric"
      config={chartConfig}
      isLoading // [!code highlight]
    >
      <RadarChart.Grid />
      <RadarChart.Radar dataKey="score" />
    </RadarChart>
  );
}

```

## API reference [#api-reference]

<ApiHeading>
  RadarChart
</ApiHeading>


  ### `data`

type: `TData[]`

One row per measure (spoke).

  ### `nameKey`

type: `keyof TData & string`

The row field that names each spoke.

  ### `config`

type: `ChartConfig`

Labels and colors for each series key. See 

    [Chart Config](/docs/charts/chart-config)

    .

  ### `min`

type: `number` · default: `0`

The value at the center.

  ### `max`

type: `number`

The value at the outer ring. Defaults to the largest value, rounded up to a readable step.

  ### `selectedDataKey`

type: `string | null`

Controlled selection; other series dim.

  ### `defaultSelectedDataKey`

type: `string | null` · default: `null`

The series selected on first render.

  ### `onSelectionChange`



void">
    Fires when a clickable legend entry selects or clears a series.

  ### `isLoading`

type: `boolean` · default: `false`

Shows the loading skeleton.

  ### `animation`

type: `boolean` · default: `true`

Plays the entrance. Reduced motion turns it off.

  ### `ariaLabel`

type: `string`

Accessible name for the plot.

  ### `chartOptions`



">
    Escape hatch merged over the ECharts option.


<ApiHeading>
  Grid
</ApiHeading>


  ### `shape`

type: `&#x22;polygon&#x22; | &#x22;circle&#x22;` · default: `&#x22;polygon&#x22;`

Ring shape.

  ### `variant`

type: `&#x22;lines&#x22; | &#x22;filled&#x22;` · default: `&#x22;lines&#x22;`

Dashed rings only, or rings with alternating bands.

  ### `rings`

type: `number` · default: `4`

Number of rings.

  ### `spokes`

type: `boolean` · default: `true`

Draws a line from the center to each measure.


<ApiHeading>
  Axis
</ApiHeading>


  ### `tickFormatter`



string">
    Formats spoke names, also used as the tooltip title.

  ### `showValues`

type: `boolean` · default: `false`

Labels ring values along the first spoke.

  ### `valueFormatter`



string">
    Formats ring values.


<ApiHeading>
  Radar
</ApiHeading>


  ### `dataKey`

type: `string`

The row field to plot, and its 

    `config`

     key.

  ### `variant`

type: `&#x22;filled&#x22; | &#x22;lines&#x22;` · default: `&#x22;filled&#x22;`

Filled area with an outline, or outline only.

  ### `dot`

type: `&#x22;none&#x22; | &#x22;default&#x22; | &#x22;border&#x22; | &#x22;colored-border&#x22; | &#x22;ping&#x22;` · default: `&#x22;none&#x22;`

Vertex points, the same styles as Line Chart dots.

  ### `fillOpacity`

type: `number` · default: `0.22`

Area opacity for the filled variant.

  ### `strokeWidth`

type: `number` · default: `1.5`

Outline width.

  ### `dashed`

type: `boolean` · default: `false`

Dashed outline.


<ApiHeading>
  Tooltip
</ApiHeading>


  ### `variant`

type: `&#x22;default&#x22; | &#x22;frosted-glass&#x22;` · default: `&#x22;default&#x22;`

Tooltip surface.

  ### `roundness`

type: `&#x22;sm&#x22; | &#x22;md&#x22; | &#x22;lg&#x22; | &#x22;xl&#x22;` · default: `&#x22;lg&#x22;`

Tooltip corner radius.

  ### `defaultIndex`

type: `number`

Shows the tooltip on this spoke until the pointer moves.

  ### `valueFormatter`



string">
    Formats values in the tooltip.


<ApiHeading>
  Legend
</ApiHeading>


  ### `variant`

type: `LegendVariant` · default: `&#x22;rounded-square&#x22;`

Indicator style.

  ### `align`

type: `&#x22;left&#x22; | &#x22;center&#x22; | &#x22;right&#x22;` · default: `&#x22;center&#x22;`

Horizontal placement.

  ### `verticalAlign`

type: `&#x22;top&#x22; | &#x22;bottom&#x22;` · default: `&#x22;bottom&#x22;`

Vertical placement.

  ### `isClickable`

type: `boolean` · default: `false`

Lets entries select a series.
