メインコンテンツまでスキップ

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​

StorybookでSimpleを開く

With Custom Pattern​

StorybookでWith Custom Patternを開く

No Labels​

StorybookでNo Labelsを開く

Custom Max​

StorybookでCustom Maxを開く

In a Wide Box​

StorybookでWide Boxを開く

See Also​