jengacore.shadcn registry · Tailwind v4 · Radix and Base UI
Components
Charts and graphs · @jengacore/chart-radial

Radial bar chart

Progress of 2 to 4 measures against one maximum, one ring each on a muted track.

Rollout progressMerchant onboarding is furthest along at 82%; branches trail at 45%.
Rollout progress: data table
MeasureProgress
Merchants onboarded82%
Agents trained64%
Branches live45%

Install

terminal
npx shadcn@latest add @jengacore/chart-radial

Without the namespace configured: npx shadcn@latest add https://ui.jengacore.com/r/<new-york-v4|base-nova>/chart-radial.json

Source

components/blocks/chart-radial.tsx
"use client"

import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"

import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent } from "@/components/ui/chart"
import { ChartFigure, type ChartCopy, seriesColor, slug } from "@/components/jc/chart-figure"

export type Progress = { name: string; value: number; color?: string }

const SAMPLE: Progress[] = [
  { name: "Merchants onboarded", value: 82 },
  { name: "Agents trained", value: 64 },
  { name: "Branches live", value: 45 },
]

/**
 * Radial bars: progress of 2–4 measures against the same maximum (100 by default), one ring each on a muted track.
 * The first measure is the innermost ring; the legend and the data table name every ring.
 */
export function ChartRadial({
  data = SAMPLE,
  max = 100,
  unit = "%",
  title = "Rollout progress",
  summary = "Merchant onboarding is furthest along at 82%; branches trail at 45%.",
  showTable,
  className,
}: {
  max?: number
  unit?: string
  showTable?: boolean
  className?: string
} & ChartCopy<Progress[]>) {
  const rows = data.map((d, i) => ({ ...d, key: slug(d.name, i), fill: `var(--color-${slug(d.name, i)})`, color: d.color ?? seriesColor(i) }))
  const config = Object.fromEntries(rows.map((d) => [d.key, { label: d.name, color: d.color }]))
  return (
    <ChartFigure
      title={title}
      summary={summary}
      data={rows.map((d) => ({ name: d.name, value: `${d.value.toLocaleString("en")}${unit}` }))}
      columns={[
        { key: "name", label: "Measure" },
        { key: "value", label: "Progress" },
      ]}
      showTable={showTable}
      className={className}
    >
      <ChartContainer config={config} className="mx-auto aspect-square h-64">
        <RadialBarChart data={rows} accessibilityLayer title={title} innerRadius="28%" outerRadius="80%" startAngle={90} endAngle={-270}>
          <PolarAngleAxis type="number" domain={[0, max]} tick={false} axisLine={false} />
          <ChartTooltip cursor={false} content={<ChartTooltipContent nameKey="key" hideLabel />} />
          <RadialBar dataKey="value" background cornerRadius={4} isAnimationActive={false} />
          <ChartLegend itemSorter={(item) => rows.findIndex((r) => r.key === (item.payload as { key?: string } | undefined)?.key)} content={<ChartLegendContent nameKey="key" />} className="flex-wrap gap-2" />
        </RadialBarChart>
      </ChartContainer>
    </ChartFigure>
  )
}