Radial Chart
Documentation Index
Fetch the complete documentation index at: /llms.txt. Use this file to discover all available pages before exploring further.
Beautiful radial bar charts with full and semi-circle variants and gradient colors
Installation
Usage
The radial chart is composable. <EvilRadialChart> is the container, and every part hangs off it as a compound member — <EvilRadialChart.Legend>, <EvilRadialChart.Tooltip>, and a <EvilRadialChart.RadialBar> — so a single import gives you the whole chart. isClickable lives on <EvilRadialChart.RadialBar>, so styling and interactivity stay with the series.
import { EvilRadialChart } from "@/components/evilcharts/charts/recharts-radial-chart";
import { type ChartConfig } from "@/components/evilcharts/ui/recharts-chart";const data = [
{ browser: "chrome", visitors: 275 },
{ browser: "safari", visitors: 200 },
{ browser: "firefox", visitors: 187 },
];
const chartConfig = {
chrome: {
label: "Chrome",
colors: { light: ["#3b82f6"], dark: ["#60a5fa"] },
},
safari: {
label: "Safari",
colors: { light: ["#10b981"], dark: ["#34d399"] },
},
firefox: {
label: "Firefox",
colors: { light: ["#f59e0b"], dark: ["#fbbf24"] },
},
} satisfies ChartConfig;<EvilRadialChart data={data} nameKey="browser" config={chartConfig} variant="full">
<EvilRadialChart.Legend isClickable />
<EvilRadialChart.Tooltip />
<EvilRadialChart.RadialBar dataKey="visitors" isClickable />
</EvilRadialChart>Interactive Selection
Add isClickable to <EvilRadialChart.RadialBar> (and <EvilRadialChart.Legend>) to make bars selectable, then handle selection with the onSelectionChange callback on <EvilRadialChart>:
<EvilRadialChart
data={data}
nameKey="browser"
config={chartConfig}
onSelectionChange={(selection) => {
if (selection) {
console.log("Selected:", selection.dataKey, "Value:", selection.value);
} else {
console.log("Deselected");
}
}}
>
<EvilRadialChart.Legend isClickable />
<EvilRadialChart.Tooltip />
<EvilRadialChart.RadialBar dataKey="visitors" isClickable />
</EvilRadialChart>Loading State
Pass the isLoading prop to show a placeholder animation while your data loads.
Examples
Radial charts in different configurations. Customize variant, innerRadius, outerRadius, and more.
Semi-Circle Variant
Set variant="semi" for a half-circle chart — compact, and ideal for progress or gauges.
Gradient Colors
API Reference
The props below are grouped by the part they belong to.
The root container. It owns the data, shared selection state, loading skeleton, and arc shape. Everything visual is composed as its children.
The radial bar series — each data row becomes one bar.
The hover tooltip, labeling each bar by name. Render it to show a tooltip; omit it for none.
The bar legend. With isClickable, each entry toggles its bar's selection. Render it to show a legend; omit it for none.