Skip to documentation content

Radar Chart

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

Basic Chart

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

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

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

npm install honestui

Usage

import { RadarChart, type ChartConfig } from "honestui/charts";
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;
<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

Circle grid

shape="circle" variant="filled"

Reference profile

variant="lines" dashed

Loading state

isLoading

API reference

RadarChart
PropTypeDefaultDescription
data*TData[]–One row per measure (spoke).
nameKey*keyof TData & string–The row field that names each spoke.
config*ChartConfig–Labels and colors for each series key. See Chart Config.
minnumber0The value at the center.
maxnumber–The value at the outer ring. Defaults to the largest value, rounded up to a readable step.
selectedDataKeystring | null–Controlled selection; other series dim.
defaultSelectedDataKeystring | nullnullThe series selected on first render.
onSelectionChange(dataKey: string | null) => void–Fires when a clickable legend entry selects or clears a series.
isLoadingbooleanfalseShows the loading skeleton.
animationbooleantruePlays the entrance. Reduced motion turns it off.
ariaLabelstring–Accessible name for the plot.
chartOptionsRecord<string, unknown>–Escape hatch merged over the ECharts option.
Grid
PropTypeDefaultDescription
shapepolygon|circle"polygon"Ring shape.
variantlines|filled"lines"Dashed rings only, or rings with alternating bands.
ringsnumber4Number of rings.
spokesbooleantrueDraws a line from the center to each measure.
Axis
PropTypeDefaultDescription
tickFormatter(name: string, index: number) => string–Formats spoke names, also used as the tooltip title.
showValuesbooleanfalseLabels ring values along the first spoke.
valueFormatter(value: number) => string–Formats ring values.
Radar
PropTypeDefaultDescription
dataKey*string–The row field to plot, and its config key.
variantfilled|lines"filled"Filled area with an outline, or outline only.
dotnone|default|border|colored-border|ping"none"Vertex points, the same styles as Line Chart dots.
fillOpacitynumber0.22Area opacity for the filled variant.
strokeWidthnumber1.5Outline width.
dashedbooleanfalseDashed outline.
Tooltip
PropTypeDefaultDescription
variantdefault|frosted-glass"default"Tooltip surface.
roundnesssm|md|lg|xl"lg"Tooltip corner radius.
defaultIndexnumber–Shows the tooltip on this spoke until the pointer moves.
valueFormatter(value: number) => string–Formats values in the tooltip.
Legend
PropTypeDefaultDescription
variantLegendVariant"rounded-square"Indicator style.
alignleft|center|right"center"Horizontal placement.
verticalAligntop|bottom"bottom"Vertical placement.
isClickablebooleanfalseLets entries select a series.