PieChart

PieChart is a component for drawing pie charts to compare multiple sets of data.

Usage

import { PieChart } from "@yamada-ui/react"
<PieChart.Root>
  <PieChart.Pie>
    <PieChart.LabelList />
  </PieChart.Pie>
  <PieChart.Label />
  <PieChart.Tooltip />
  <PieChart.Legend />
</PieChart.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 Pies

Add Label

To display labels, set label or pieProps.label to true. The default is false.

Add Label Line

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

Change Label Offset

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

Add Label List

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

Change Padding Angle

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

Change Start Angle

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

Change End Angle

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

Change Inner Radius

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

Change Outer Radius

To change the outer radius, set outerRadius of series or pieProps.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