For the complete documentation index, see llms.txt. This page is also available as Markdown.

PieChart

PieChart draws a pie chart.

Creation

Instantiate PieChart via rememberPieChart.

val chart = rememberPieChart(/* ... */)

PieChart accepts a SliceProvider instance, which supplies Slice instances for successive entries. Use SliceProvider.series for the standard repeating-series setup.

Each pie-slice style can define fill, stroke, an offset from the center, and an optional SliceLabel. There are two built-in label types:

Use PieValueFormatter to format slice labels.

You can also customize slice spacing, the start angle, and the inner and outer sizes. A nonzero inner size produces a donut chart.

For an example, see the “Basic pie chart” sample chart.

Last updated