Pie Chart

Draw Style
You can change chart style to stroke:
Start Degree
You can set specific start degree for starting slices
Labeling
Display labels directly on pie slices using the OnPie labeling mode.
When LabelMode.OnPie() is enabled, two different labels can be displayed:
- Outer Label – Displays the data label outside the slice and connects it with a guide line.
- Inner Label – Displays additional information inside the slice. By default, this is the slice percentage.
Configuration
LabelMode.OnPie() provides several customization options:
| Parameter | Description | Default |
|---|---|---|
outerLineSize |
Length of the guide line drawn outside each slice. The first value controls the radial segment, and the second controls the horizontal segment. | 12.dp to 16.dp |
outerLineStyle |
Controls the appearance of the guide line (width, stroke style, etc.). | Stroke(width = 1.5.dp) |
innerLabelStyle |
Text style used for the inner label. | White, 12.sp, Bold |
show |
Determines whether labels should be shown for a specific slice. | { true } |
innerLabelContent |
Controls the content displayed inside each slice. | PieInnerLabelContent.Percentage() |
animationSpec |
Animation used when labels appear. | tween(300, delayMillis = 100) |
Showing Labels Conditionally
The show callback allows you to display labels only for specific slices.
For example, show labels only for selected slices:
This is useful for hiding labels on very small slices and keeping the chart readable.
Customizing the Inner Label
By default, the inner label displays the percentage of each slice.
You can replace it with any supported PieInnerLabelContent implementation:
Note
PieInnerLabelContent is responsible only for the content displayed inside the slice. The outer label always displays the slice label.
Styling
Customize both the guide line and the text appearance:
Animating Labels
Labels are animated independently from the pie chart.
Set animationSpec to any Compose AnimationSpec<Float> implementation to achieve the desired animation behavior.
Info
Label animations start after the corresponding slice animation reaches its visible state, resulting in a smoother appearance.