Charts and graphs · @jengacore/chart-radar
Radar chart
One profile per series over the same 5 to 8 axes; the first series filled, the rest outlined.
Service scorecard (0 to 100)This quarter beats target on success rate and support, and misses it most on reconciliation (74 against 90).
| Measure | This quarter | Target |
|---|---|---|
| Uptime | 92 | 95 |
| Latency | 81 | 85 |
| Success rate | 96 | 90 |
| Reconciliation | 74 | 90 |
| Support | 88 | 80 |
| Onboarding | 67 | 75 |
Install
terminal
npx shadcn@latest add @jengacore/chart-radarWithout the namespace configured: npx shadcn@latest add https://ui.jengacore.com/r/<new-york-v4|base-nova>/chart-radar.json
Registry dependencies
Source
components/blocks/chart-radar.tsx
"use client"
import { PolarAngleAxis, PolarGrid, Radar, RadarChart } from "recharts"
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart"
import { ChartFigure, type ChartCopy, seriesConfig, seriesDash, type ChartSeries } from "@/components/jc/chart-figure"
type Row = Record<string, string | number>
const SAMPLE: Row[] = [
{ metric: "Uptime", current: 92, target: 95 },
{ metric: "Latency", current: 81, target: 85 },
{ metric: "Success rate", current: 96, target: 90 },
{ metric: "Reconciliation", current: 74, target: 90 },
{ metric: "Support", current: 88, target: 80 },
{ metric: "Onboarding", current: 67, target: 75 },
]
const SAMPLE_SERIES: ChartSeries[] = [
{ key: "current", label: "This quarter" },
{ key: "target", label: "Target" },
]
/** Radar: one profile per series over the same 5–8 axes, each outline in its own dash pattern. */
export function ChartRadar({
data = SAMPLE,
axisKey = "metric",
axisLabel = "Measure",
series = SAMPLE_SERIES,
title = "Service scorecard (0 to 100)",
summary = "This quarter beats target on success rate and support, and misses it most on reconciliation (74 against 90).",
showTable,
className,
}: {
axisKey?: string
axisLabel?: string
series?: ChartSeries[]
showTable?: boolean
className?: string
} & ChartCopy<Row[]>) {
const config = seriesConfig(series)
return (
<ChartFigure
title={title}
summary={summary}
data={data}
columns={[{ key: axisKey, label: axisLabel }, ...series.map((s) => ({ key: s.key, label: s.label }))]}
showTable={showTable}
className={className}
>
<ChartContainer config={config} className="mx-auto aspect-square h-72">
<RadarChart data={data} accessibilityLayer title={title} outerRadius="70%">
<ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
<PolarGrid />
<PolarAngleAxis dataKey={axisKey} tick={{ fill: "var(--muted-foreground)", fontSize: 11 }} />
{series.map((s, i) => (
<Radar
key={s.key}
dataKey={s.key}
fill={`var(--color-${s.key})`}
fillOpacity={i === 0 ? 0.22 : 0}
stroke={`var(--color-${s.key})`}
strokeWidth={2}
strokeDasharray={seriesDash(i)}
isAnimationActive={false}
/>
))}
<ChartLegend itemSorter={(item) => series.findIndex((s) => s.key === item.dataKey)} content={<ChartLegendContent />} />
</RadarChart>
</ChartContainer>
</ChartFigure>
)
}