DonutChart

DonutChart is a component for drawing donut charts to compare multiple sets of data.

Usage

import { DonutChart } from "@yamada-ui/react"
<DonutChart.Root>
  <DonutChart.Donut>
    <DonutChart.LabelList />
  </DonutChart.Donut>
  <DonutChart.Label />
  <DonutChart.Tooltip />
  <DonutChart.Legend />
</DonutChart.Root>

Composition

Change Size

Change Color

Change Sector Colors

Hide Sector Stroke

To hide sector stroke lines, set sectorStroke to "none".

Add Legend

To add the legend, set withLegend to true. The default is false. To change the placement of the legend, set legendProps.placement to "start-start", "end-end", etc. The default is "start-end".

Display Multiple Donuts

To display multiple donuts in one chart, set multiple entries in series.

Add Label

To display labels, set label of series or donutProps.label to true. The default is false.

Add Label Line

To display label lines, set labelLine of series or donutProps.labelLine to true. The default is false.

Change Label Offset

To change the label offset, set label.offset of series or donutProps.label.offset to a number. The default is 0.

Add Label List

To display values with label list, set labelList to true of series or donutProps.labelList. The default is false.

Center Label

Change Padding Angle

To change the padding angle, set paddingAngle of series or donutProps.paddingAngle to a number. The default is 0.

Change Start Angle

To change the start angle, set startAngle of series or donutProps.startAngle to a number. The default is 90.

Change End Angle

To change the end angle, set endAngle of series or donutProps.endAngle to a number. The default is -270.

Change Inner Radius

To change the inner radius, set innerRadius of series or donutProps.innerRadius to a number or string. The default is "70%".

Change Outer Radius

To change the outer radius, set outerRadius of series or donutProps.outerRadius to a number or string. The default is "100%".

Sync

To sync charts, set syncId to a string.

Format

To format values and labels, use formatter.

Hide Tooltip

To hide the tooltip, set withTooltip to false. The default is true.

Props