Radar Chart
Documentation Index
Fetch the complete documentation index at: /llms.txt. Use this file to discover all available pages before exploring further.
Beautiful radar charts with filled and lines variants, gradient colors, and glow effects
Installation
Usage
The radar chart is a composible compound component. <EvilRadarChart /> is the root container — every visual part (<PolarGrid />, <PolarAngleAxis />, <Tooltip />, <Legend />, and the <Radar /> series) is composed as a child, so you render exactly what you need.
import {
EvilRadarChart,
Radar,
PolarGrid,
PolarAngleAxis,
Tooltip,
Legend,
Dot,
ActiveDot,
} from "@/components/evilcharts/charts/radar-chart";const data = [
{ skill: "JavaScript", desktop: 186, mobile: 80 },
{ skill: "TypeScript", desktop: 305, mobile: 200 },
{ skill: "React", desktop: 237, mobile: 120 },
{ skill: "Node.js", desktop: 173, mobile: 190 },
{ skill: "CSS", desktop: 209, mobile: 130 },
];
const chartConfig = {
desktop: {
label: "Desktop",
colors: { light: ["#3b82f6"], dark: ["#60a5fa"] },
},
mobile: {
label: "Mobile",
colors: { light: ["#10b981"], dark: ["#34d399"] },
},
} satisfies ChartConfig;
<EvilRadarChart data={data} config={chartConfig}>
<PolarGrid />
<PolarAngleAxis dataKey="skill" />
<Legend />
<Tooltip />
<Radar dataKey="desktop" variant="filled">
<Dot variant="colored-border" />
<ActiveDot variant="default" />
</Radar>
<Radar dataKey="mobile" variant="filled" />
</EvilRadarChart>Interactive Selection
Set isClickable on a <Radar /> to let it be selected by clicking, and on <Legend /> to let legend entries toggle selection. Use the root's onSelectionChange callback to react to selection events:
<EvilRadarChart
data={data}
config={chartConfig}
onSelectionChange={(selectedDataKey) => {
if (selectedDataKey) {
console.log("Selected:", selectedDataKey);
} else {
console.log("Deselected");
}
}}
>
<PolarGrid />
<PolarAngleAxis dataKey="skill" />
<Legend isClickable />
<Tooltip />
<Radar dataKey="desktop" variant="filled" isClickable />
<Radar dataKey="mobile" variant="filled" isClickable />
</EvilRadarChart>Loading State
The radar chart supports loading state with animated data. You can pass the isLoading prop to the root to show a loading animation while your data is being fetched.
<EvilRadarChart data={[]} config={chartConfig} isLoading>
<PolarGrid />
<PolarAngleAxis dataKey="skill" />
<Legend />
<Tooltip />
<Radar dataKey="desktop" variant="filled" />
<Radar dataKey="mobile" variant="filled" />
</EvilRadarChart>Examples
Below are some examples of the radar chart with different configurations.
Lines Variant
Set variant="lines" to show only the outline without fill. This is useful for comparing multiple datasets more clearly.
Circle Grid
Set gridType="circle" to use circular grid lines instead of the default polygon grid.
Gradient Colors
Glowing Radars
Add a subtle glow effect to a radar by setting isGlowing on its <Radar />. Each radar controls its own glow independently.
API Reference
The radar chart is composed of a root container and a set of composible parts. Each part is documented in its own section below.
The root container. Owns the data, the shared context, and the loading skeleton. All other parts must be rendered as its children.
A single radar series. Each <Radar /> is self-contained — it generates its own gradients and glow filter under a unique id, so multiple radars never collide on styles. Compose <Dot /> and <ActiveDot /> inside it to add point markers.
Configuration slots composed inside a <Radar />. <Dot /> styles the resting point markers; <ActiveDot /> styles the hovered/active marker. They render nothing on their own.
The polar grid lines. Defaults to a dashed polygon grid and forwards every Recharts PolarGrid prop.
The angular category axis — the labels around the chart's perimeter. Hidden automatically while the chart is loading.
The radial value axis — the scale running from the center outward. Hidden automatically while the chart is loading.
The hover tooltip. Reads the chart's selection so its content dims unselected series. Hidden automatically while the chart is loading.
The series legend. When isClickable is set, each entry toggles selection of its series. Hidden automatically while the chart is loading.