Skip to main content

RadarChart

Every example on this page is live, drawn by the library's Storybook, where you can also change its props and see the result.

A spider/radar chart for multi-dimensional comparisons. Draws a filled polygon over a spoke for each axis and the outline of the scale's maximum. Requires at least 3 axes and a value other than zero.

The chart keeps its proportions in any box: it is drawn as large as the box holds and centered, in the widget and in its previews alike. A value above max reaches past the outline.

Import​

import { RadarChart } from "~lib/charts/radar-chart";

Props​

NameTypeRequiredDefaultDescription
data{ axis: string; value: number }[]YesN/AAxis data (min 3 axes)
maxnumberNoautoMaximum scale value (defaults to data max)
patternPatternTypeNo"diagonal"Fill pattern for the data polygon
showLabelsbooleanNotrueShow axis labels
widthnumber | stringNo300Chart width
heightnumber | stringNo300Chart height

PatternType: "solid" | "diagonal" | "dots" | "crosshatch"

Examples​

Simple​

Open Simple in Storybook

With Custom Pattern​

Open With Custom Pattern in Storybook

No Labels​

Open No Labels in Storybook

Custom Max​

Open Custom Max in Storybook

In a Wide Box​

Open Wide Box in Storybook

See Also​