/

Donut Chart

A pie chart with a center cutout. Perfect for displaying a key metric in the center while showing proportional data around it.

Usage

example.tsx
import { DonutChart } from "@chartts/react"

<DonutChart
  data={trafficData}
  value="visitors"
  label="source"
  centerLabel="1.2M"
/>

Props

PropTypeDescription
dataT[]Array of data objects
valuekeyof TKey for segment values
labelkeyof TKey for segment labels
innerRadiusnumberInner radius ratio. 0-1. Default: 0.6
centerLabelstring | ReactNodeContent displayed in the center
padAnglenumberPadding between segments. Default: 2

Features

  • Center label/metric display
  • Interactive segment hover
  • Custom inner radius
  • Animated reveal
  • Auto-positioned outside labels
  • Responsive sizing

Other Charts