Zum Hauptinhalt springen

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​

Simple in Storybook öffnen

With Custom Pattern​

With Custom Pattern in Storybook öffnen

No Labels​

No Labels in Storybook öffnen

Custom Max​

Custom Max in Storybook öffnen

In a Wide Box​

Wide Box in Storybook öffnen

See Also​