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.
| Metric | Apollo values | Zephyr 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.
| Metric | Scout values |
|---|---|
| Combat: | 40. |
| Stealth: | 90. |
| Support: | 55. |
| Mobility: | 85. |
| Defense: | 45. |
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
categories | readonly string[] | — | Spoke labels, one per axis; fewer than 3 renders nothing |
series | readonly RadarSeries[] | — | Series to plot; data aligns index-by-index with categories |
width | number | — | Controlled layout width; enables deterministic SSR |
initialWidth | number | — | SSR width hint replaced by client measurement |
height | number | 280 | SVG height in px — width is measured from the container |
max | number | — | Outer axis value; defaults to a nice bound of the data max |
levels | number | 4 | Concentric grid rings |
showGrid | boolean | true | Show the ring polygons and spoke lines |
showCategoryLabels | boolean | true | Show spoke labels; web radius adapts to their estimated width |
showTooltip | boolean | true | Show the hover tooltip |
showLegend | boolean | true | Show the legend when there are 2+ series |
animate | boolean | true | Webs bloom open from the center on mount |
formatters | ChartFormatters | — | Format metric/series labels and values across every surface |
label | string | — | Accessible name; defaults to the joined series labels |
labels | ChartLabels | — | Screen-reader text of the data table and the legend, for translation |
showLabel | boolean | false | Render label as a visible title above the plot |
sx | StyleXStyles | — | StyleX style override |
RadarSeries
| Field | Type | Description |
|---|---|---|
id | string | Stable data identity |
label | string | Legend / tooltip label, falls back to id |
colorIndex | number | Palette slot 0–7; defaults to input order |
data | readonly (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
labelprovides the concise image name.descriptionadds a richer summary througharia-describedby; consumer-owned text or a visible table can be linked with thearia-describedbyprop.- Matrices up to 20 rows / 100 cells receive a visually hidden native data table.
accessibleDatareplaces that table with custom React content; passnullto suppress it.labelstranslates 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
nullor negative value is treated as0: 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.