Moul UIBeta
ComponentsCharts

DoughnutChart

Documentation for the DoughnutChart component.

DoughnutChart

A beautiful doughnut (pie) chart featuring rounded sectors, animations, and active segment highlight interactions.

Preview

All requests

United States7.53k
Netherlands4.67k
Singapore1.4k
Canada1.37k
Ireland271
India270
Brazil154
+3 more

Import

import { DoughnutChart, ChartContainer } from '@moul-dev/ui';

Usage

import { DoughnutChart, ChartContainer } from '@moul-dev/ui';

export default function Example() {
  const data = [
    { country: 'United States', value: 7530 },
    { country: 'Netherlands', value: 4670 },
    { country: 'Singapore', value: 1400 },
  ];

  return (
    <ChartContainer title="Request distribution">
      <DoughnutChart
        data={data}
        nameKey="country"
        valueKey="value"
        height={260}
      />
    </ChartContainer>
  );
}

Props

DoughnutChart Props

PropTypeDefaultDescription
dataany[]Array of category data.
nameKeystringKey representing slice labels.
valueKeystringKey representing slice quantities.
colorsstring[]CHART_COLORSArray of colors for slices.
innerRadiusnumber | string'65%'Inner circle diameter cut-out.
outerRadiusnumber | string'85%'Outer circle diameter.
paddingAnglenumber3Angle gaps between slices.
valueFormatter(value: any) => stringTooltip values formatter.
heightnumber | string300Render height.

On this page