RadarChart

Multi-axis comparison over category spokes.

Import

import { RadarChart } from '@matix/charts/radar-chart';

Usage

Each series becomes a polygon whose vertices sit on shared category spokes, so two profiles can be compared shape-against-shape at a glance.

Data for Apollo, Zephyr
MetricApollo valuesZephyr values
Speed:80.65.
Reliability:70.85.
Comfort:60.90.
Safety:90.70.
Efficiency:75.60.
Style:65.80.

Single series

A lone series needs no legend — the surrounding heading names it.

Data for Scout
MetricScout values
Combat:40.
Stealth:90.
Support:55.
Mobility:85.
Defense:45.

API Reference

PropTypeDefaultDescription
categoriesreadonly string[]—Spoke labels, one per axis; fewer than 3 renders nothing
seriesreadonly RadarSeries[]—Series to plot; data aligns index-by-index with categories
widthnumber—Controlled layout width; enables deterministic SSR
initialWidthnumber—SSR width hint replaced by client measurement
heightnumber280SVG height in px — width is measured from the container
maxnumber—Outer axis value; defaults to a nice bound of the data max
levelsnumber4Concentric grid rings
showGridbooleantrueShow the ring polygons and spoke lines
showCategoryLabelsbooleantrueShow spoke labels; web radius adapts to their estimated width
showTooltipbooleantrueShow the hover tooltip
showLegendbooleantrueShow the legend when there are 2+ series
animatebooleantrueWebs bloom open from the center on mount
formattersChartFormatters—Format metric/series labels and values across every surface
labelstring—Accessible name; defaults to the joined series labels
labelsChartLabels—Screen-reader text of the data table and the legend, for translation
showLabelbooleanfalseRender label as a visible title above the plot
sxStyleXStyles—StyleX style override

RadarSeries

FieldTypeDescription
idstringStable data identity
labelstringLegend / tooltip label, falls back to id
colorIndexnumberPalette slot 0–7; defaults to input order
datareadonly (number | null)[]Finite values aligned with categories; invalid/negative collapses to 0

Series arrays must match categories.length. Development builds warn with the series id and first invalid index.

Accessibility

  • label provides the concise image name. description adds a richer summary through aria-describedby; consumer-owned text or a visible table can be linked with the aria-describedby prop.
  • Matrices up to 20 rows / 100 cells receive a visually hidden native data table. accessibleData replaces that table with custom React content; pass null to suppress it. labels translates the table text and the legend name.
  • Grid, spoke, label, and mark elements remain aria-hidden; the chart is one image target and the table carries metric values.
  • The legend pairs every palette swatch with a text label; it does not claim a second visual encoding beyond color.
  • A null or negative value is treated as 0: its vertex collapses to the center rather than inverting the spoke.
  • The pointer tooltip is supplemental; the table carries values for assistive technology.

Server rendering

Pass width for deterministic server-rendered SVG. Use initialWidth for responsive hydration from a server estimate. Without either prop, the wrapper reserves height before client measurement.