data: [{ label, value, color? }]. Add donut (and optionally center) for a ring. Hover a slice for its label, value and share in a tooltip that follows the mouse.

  • Kevin: 62 (62%)
  • Stuart: 21 (21%)
  • Bob: 9 (9%)
  • Others: 8 (8%)
  • Kevin
  • Stuart
  • Bob
  • Others
100%
  • Eaten: 70 (70%)
  • Left: 30 (30%)
  • Eaten
  • Left

When the data changes the slices swing to their new size; the tooltip and legend always show the real values.

  • Kevin: 36 (35%)
  • Stuart: 36 (35%)
  • Bob: 31 (30%)
  • Kevin
  • Stuart
  • Bob

Props

  • data{ label, value, color? }[]

    Slices.

  • donutboolean
    Default: false

    Render a ring.

  • centerReactNode

    Text in the donut hole.

  • labelstring
    Default: 'Pie chart'

    Accessible name.

  • animateboolean
    Default: true

    Animate the chart in when it appears and glide it to new values when the data changes (skipped for users who prefer reduced motion).

  • classNamestring
    Default: ''

    Extra classes for the root element.