Donut Chart

A donut chart to show how much each part weighs in the whole: payment methods, channels, plans. The total sits in the center and becomes the value of the slice the person points at or selects with the keyboard; the legend brings value and percentage and the View table button shows the numbers.

Vendas por forma de pagamentoSetembro de 2026
Use the arrow keys to read each part, or the View table button.
TotalR$ 97.600
  • PixR$ 48.23049%
  • Cartão de créditoR$ 31.84033%
  • Cartão de débitoR$ 12.41013%
  • BoletoR$ 5.1205,2%

Settings

Legenda

Examples

Customer plans, with a fixed color per plan

Clientes por plano
Use the arrow keys to read each part, or the View table button.
Clientes754
  • Essencial41255%
  • Profissional26836%
  • Empresa749,8%

Thin, with the rest in “Other”

De onde vêm os pedidosÚltimos 30 dias
Use the arrow keys to read each part, or the View table button.
Total1.215
  • Site54044%
  • Instagram31026%
  • WhatsApp22819%
  • iFood967,9%
  • Outros413,4%

Installation

The command creates components/ui/donut-chart.tsx in your project and installs the theme with it. The file is yours: edit it as you like.

npx @ravox-ui/cli add donut-chart

Props

PropTypeDefaultDescription
titlestring—Visible title; also names the chart for screen readers.
slicesDonutSlice[]—{ label, value, color? }. color: "blue" | "yellow" | "pink" | "lime" or any CSS color.
format(value: number) => stringnúmero pt-BRFormats the values ($, %, units).
totalLabelstring"Total"What appears in the center above the total.
sizenumber180Side of the drawing in px.
thicknessnumber0.28Ring thickness as a fraction of the radius, from 0.1 to 0.5.
legend"side" | "bottom""side"Where the legend goes.
descriptionReactNode—Line below the title (period, source).
tableTogglebooleantrueShows the View table button.

More in Data