Radar Chart
Documentation Index
Fetch the complete documentation index at: /llms.txt. Use this file to discover all available pages before exploring further.
Radar charts with filled and line variants, gradients, and glow effects
Installation
Usage
<EvilRadarChart /> is the root of a composable compound component. Every visual part (<EvilRadarChart.PolarGrid />, <EvilRadarChart.PolarAngleAxis />, <EvilRadarChart.Tooltip />, <EvilRadarChart.Legend />, and the <EvilRadarChart.Radar /> series) composes as a child — render only what you need.
<script lang="ts">
import { EvilRadarChart } from '$lib/components/evilcharts/charts/layerchart-radar-chart';
import { type ChartConfig } from '$lib/components/evilcharts/ui/layerchart-chart';
</script> <script lang="ts">
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;
</script>
<EvilRadarChart {data} config={chartConfig}>
<EvilRadarChart.PolarGrid />
<EvilRadarChart.PolarAngleAxis dataKey="skill" />
<EvilRadarChart.Legend />
<EvilRadarChart.Tooltip />
<EvilRadarChart.Radar dataKey="desktop" variant="filled">
<EvilRadarChart.Dot variant="colored-border" />
<EvilRadarChart.ActiveDot variant="default" />
</EvilRadarChart.Radar>
<EvilRadarChart.Radar dataKey="mobile" variant="filled" />
</EvilRadarChart> Interactive Selection
Set isClickable on a <Radar /> or <Legend /> to toggle selection by clicking. The root’s onSelectionChange callback fires on every selection change:
<EvilRadarChart
{data}
config={chartConfig}
onSelectionChange={(selectedDataKey) => {
if (selectedDataKey) {
console.log('Selected:', selectedDataKey);
} else {
console.log('Deselected');
}
}}
>
<EvilRadarChart.PolarGrid />
<EvilRadarChart.PolarAngleAxis dataKey="skill" />
<EvilRadarChart.Legend isClickable />
<EvilRadarChart.Tooltip />
<EvilRadarChart.Radar dataKey="desktop" variant="filled" isClickable />
<EvilRadarChart.Radar dataKey="mobile" variant="filled" isClickable />
</EvilRadarChart> Loading State
Pass isLoading to the root to show an animated loading skeleton while your data is being fetched.
<EvilRadarChart data={[]} config={chartConfig} isLoading>
<EvilRadarChart.PolarGrid />
<EvilRadarChart.PolarAngleAxis dataKey="skill" />
<EvilRadarChart.Legend />
<EvilRadarChart.Tooltip />
<EvilRadarChart.Radar dataKey="desktop" variant="filled" />
<EvilRadarChart.Radar dataKey="mobile" variant="filled" />
</EvilRadarChart> Examples
Radar charts in different configurations.
Lines Variant
Set variant="lines" to show only the outline without fill — clearer for comparing multiple datasets.
Circle Grid
Set gridType="circle" to use circular grid lines instead of the default polygon grid.
Gradient Colors
Glowing Radars
Set isGlowing on a <Radar /> for a soft glow. Each radar controls its own glow independently.
Dither rendering
Set renderStyle="dither" on the existing radar root for ordered-dither polygons while the SVG grid, axes, dots, tooltip, and selection targets remain authoritative. A radar-level ditherVariant overrides the root texture.
The renderer is independently implemented for EvilCharts SV and inspired by Dither Kit by Boring Software.
API Reference
A root container plus a set of composable parts, each documented below.
The root container. Owns the data, shared context, and loading skeleton. All other parts render as its children.
A single radar series. Each <Radar /> generates its own gradients and glow filter under a unique id, so radars never collide on styles. Compose <Dot /> and <ActiveDot /> inside for point markers.
Configuration slots inside a <Radar />. <Dot /> styles the resting markers; <ActiveDot /> styles the active marker. Neither renders anything on its own.
The polar grid lines. Defaults to a dashed polygon grid and forwards every LayerChart PolarGrid prop.
The angular category axis — the labels around the chart’s perimeter. Hidden while loading.
The radial value axis — the scale from center outward. Hidden while loading.
The hover tooltip. Dims unselected series based on the chart’s selection. Hidden while loading.
The series legend. With isClickable, each entry toggles selection of its series. Hidden while loading.