apps/www/content/docs/charts/donut-chart.mdx
import { Chart, useChart } from "@chakra-ui/charts"
import { Pie, PieChart, Sector } from "recharts"
<Chart.Root chart={chart}>
<PieChart>
<Pie shape={(props) => <Sector {...props} />} />
</PieChart>
</Chart.Root>
To display a point label on the chart, use the PointLabel component from
recharts.
Customizing the startAngle and endAngle prop of the <Pie> component can
create partial donuts.
<Pie startAngle={180} endAngle={0}>
</Pie>
To add some space between the segments, use the paddingAngle prop.
<ExampleTabs name="charts/donut-chart-with-angle-padding" />Pro Tip: To round the corners of the segments, use the
cornerRadiusprop.
To create an effect where the active segment is scaled and detached from the
rest of the segments, use the activeIndex prop and the activeShape prop.
<Pie
innerRadius={60}
outerRadius={100}
activeIndex={0}
activeShape={<Sector outerRadius={120} />}
/>
Use the Chart.RadialText component to display a centered text on the chart
with an optional description.
<Label
content={({ viewBox }) => (
<Chart.RadialText viewBox={viewBox} title={1200} description="users" />
)}
/>