Mario Charts
ChartsExamplesDocs
Mario Charts
 Star Mario Charts on GitHub
Star Mario Charts on GitHub
Introduction
Installation
AI Agents
Bar Chart
Line Chart
Pie Chart
Radar Chart
Scatter Plot
Stacked Bar Chart
Gauge Chart
Heatmap
Funnel Chart
Sankey Chart
TreeMap
Waterfall Chart
Sales & Revenue
Website Analytics
Loading chart documentation…

Components

Radar Chart

Compare the profile of a few series across several dimensions. Inspect each value and its range, with a polygon or circular reference grid.

Install
npx mario-charts@latest add radar-chart

Playground

Compare grid styles, scales, loading, and interaction.

Settings

The same chart through every state.

Team skills

Illustrative assessment · 0 to 100 on each axis

Waiting for chart space

Hover or tap a point. Left/Right changes axis; Up/Down changes team. Enter selects.

Usage

tsx
import { RadarChart, type RadarAxis } from "@/components/charts/radar-chart";

type Scores = { frontend: number; backend: number; database: number; devops: number; design: number };
const axes = [
  { key: "frontend", label: "Frontend", min: 0, max: 100 },
  { key: "backend", label: "Backend", min: 0, max: 100 },
  { key: "database", label: "Database", min: 0, max: 100 },
  { key: "devops", label: "DevOps", min: 0, max: 100 },
  { key: "design", label: "Design", min: 0, max: 100 },
] satisfies readonly RadarAxis<Scores>[];

const series = [
  { id: "atlas", name: "Team Atlas", data: { frontend: 85, backend: 70, database: 90, devops: 60, design: 75 } },
  { id: "nova", name: "Team Nova", data: { frontend: 65, backend: 90, database: 65, devops: 85, design: 50 } },
];

export function TeamSkills() {
  return <RadarChart axes={axes} series={series} height={400} ariaLabel="Team skills comparison" />;
}

Reading the chart

Use the same explicit range when dimensions share a scale, such as these 0–100 scores. With automatic ranges, the same distance from the center can represent different values on different axes. Hover or focus a point to see its range.

Negative values are supported when the axis range includes them. The center represents that axis’s minimum, which may be below zero. All-zero observations stay at the center of a 0–100 scale and remain keyboard accessible.

Keep the number and order of dimensions consistent. Polygon area depends on the chosen ranges and axis order; use the individual observations for exact comparisons. Missing observations and values outside explicit bounds produce an error instead of a misleading shape.

API Reference

PropTypeDefaultDescription
seriesRequired
readonly RadarSeries<T>[]—Series with unique id, name, data, and optional color. Every axis needs a finite observation, including an explicit zero when measured.
axesRequired
readonly RadarAxis<T>[]—At least three unique keys from T, with label and optional min/max. Order determines the polygon; keep it consistent between comparisons.
gridType
'polygon' | 'circular''polygon'Shape of the reference grid. The data remains a polygon connecting measured vertices.
gridLevels
number5Concentric grid levels, as an integer from 1 to 20. Each level is the same fraction of each axis range.
height
number400Total frame height including the legend, in loading, empty, error, and ready states.
colors
readonly string[]DEFAULT_COLORSColors follow series order. A series color overrides the palette.
showLegend
booleanseries.length > 1Wrapping, scrollable legend with keyboard inspection and optional series selection.
showDots
booleantrueShow data markers. Hover, touch, and keyboard inspection remain available when hidden.
showAxisLabels
booleantrueWrap labels in bounded boxes; full names remain in accessible labels and the data table.
showAxisLines
booleantrueShow spokes from the center to each axis endpoint.
showGridLines
booleantrueShow the reference grid.
labelOffset
number30Label distance in pixels, reduced on narrow frames to keep labels inside the chart.
fillOpacity
number0.25Polygon fill opacity, from 0 to 1.
strokeWidth
number2Finite, nonnegative polygon stroke width in pixels.
loading
booleanfalseRetain series for a skeleton with identical geometry. Without data, show a neutral placeholder.
error
string | nullnullShow an actionable error inside the existing frame.
animation
booleantrueGrow data from the fixed center, leaving the reference grid still. Respects reduced motion; keyboard focus completes entrance immediately.
valueFormatter
(value: number, axis: RadarAxis<T>) => stringformatValueFormat values and ranges in tooltips and accessible data. Use the axis key for units.
onSeriesClick
(series: RadarSeries<T>, index: number) => void—Original series and index, from a polygon, point, legend click, or keyboard activation.
onAxisClick
(axis: RadarAxis<T>, index: number) => void—Original axis and index. Axis labels and endpoints are keyboard accessible when this callback is provided.
tooltipRenderer
TooltipRenderer<RadarChartTooltipData<T>>—Custom content with original data, series name and color. Point inspection adds axisLabel, parsed value, formattedValue, and type 'point'.
ariaLabel
string—Accessible chart name.
description
string—Context prepended to keyboard instructions and the scale explanation.
className
string—Additional classes for the persistent chart frame.