# Radial Chart (/ui/components/react/radial-chart)

A radial chart bends a bar into an arc, for progress toward a target. Like every chart here it is a recipe: [Recharts](https://recharts.github.io) draws it and the [chart layer](/ui/components/react/charts) themes it. Each example below is a complete file to paste and adapt. For a plain quota in a row or a card, [`Meter`](/ui/components/react/meter) does the job without Recharts.

## Installation [#installation]

Recharts is the only extra dependency, with `react-is` at the same version as `react`:

```bash
pnpm add recharts react-is   # or: npm install recharts react-is / yarn add recharts react-is / bun add recharts react-is
```

The examples import the chart layer from `@/components/chart`. If your project doesn't have it yet, copy it from the [Charts](/ui/components/react/charts#the-chart-layer) page first.

## Examples [#examples]

### Gauge [#gauge]

A half circle in a frame with `aspect-2/1`, with the value as HTML over it. The value is a fraction, so the angle axis runs from 0 to 1, and `background` draws the track behind the bar. Its accessible name carries the value, because a gauge has no tooltip.

```tsx
'use client'

import { PolarAngleAxis, RadialBar, RadialBarChart } from 'recharts'
import { Chart, chartColors, useChartMotion } from '@/components/chart'

const used = 0.72

const percent = new Intl.NumberFormat('en-US', { style: 'percent' })

export default function RadialChartGauge() {
  const motion = useChartMotion()

  return (
    <div className="w-full max-w-2xl">
      <Chart className="relative mx-auto aspect-2/1 h-auto max-w-sm">
        <RadialBarChart
          responsive
          data={[{ used }]}
          startAngle={180}
          endAngle={0}
          cy="100%"
          innerRadius="150%"
          outerRadius="200%"
          aria-label={`Storage used: ${percent.format(used)}`}
        >
          <PolarAngleAxis type="number" domain={[0, 1]} tick={false} tickLine={false} axisLine={false} />
          <RadialBar dataKey="used" fill={chartColors[0]} background cornerRadius={8} {...motion.series} />
        </RadialBarChart>
        <p className="pointer-events-none absolute inset-x-0 bottom-0 flex flex-col items-center">
          <span className="text-foreground-intense text-3xl font-semibold tabular-nums">{percent.format(used)}</span>
          <span className="text-foreground-muted text-xs">of 500 GB used</span>
        </p>
      </Chart>
    </div>
  )
}
```

### Rings [#rings]

1 ring per row of the data, each with its own `fill`. A category `PolarRadiusAxis` names the rings for the tooltip, and `reversed` puts the first row on the outside.

```tsx
'use client'

import { Legend, PolarAngleAxis, PolarRadiusAxis, RadialBar, RadialBarChart, Tooltip } from 'recharts'
import { Chart, ChartLegend, ChartTooltip, chartColors, useChartMotion } from '@/components/chart'

const data = [
  { name: 'Revenue', progress: 0.82, fill: chartColors[0] },
  { name: 'Orders', progress: 0.64, fill: chartColors[1] },
  { name: 'Signups', progress: 0.46, fill: chartColors[2] },
]

const percent = new Intl.NumberFormat('en-US', { style: 'percent' })

export default function RadialChartRings() {
  const motion = useChartMotion()

  return (
    <div className="w-full max-w-2xl">
      <Chart className="h-72">
        <RadialBarChart
          responsive
          data={data}
          startAngle={90}
          endAngle={-270}
          innerRadius="45%"
          outerRadius="100%"
          barCategoryGap={6}
          aria-label="Progress toward the quarter's goals"
        >
          <PolarAngleAxis type="number" domain={[0, 1]} tick={false} tickLine={false} axisLine={false} />
          <PolarRadiusAxis type="category" dataKey="name" reversed tick={false} tickLine={false} axisLine={false} />
          <Tooltip cursor={false} content={<ChartTooltip formatValue={(value) => percent.format(value)} />} />
          <Legend itemSorter={null} content={<ChartLegend />} />
          <RadialBar name="Progress" dataKey="progress" background cornerRadius={8} {...motion.series} />
        </RadialBarChart>
      </Chart>
    </div>
  )
}
```

## Accessibility [#accessibility]

- Pass `aria-label` to the chart with what it shows. On a gauge include the value (`"Storage used: 72%"`), since nothing else announces it.
- The value over a gauge is real text, not part of the SVG.
- Rings need a `Legend`, and their tooltip names each ring, so color is never the only cue.
- Nothing animates under reduced motion.
