PieChart

fun PieChart(data: List<PieSlice>, modifier: Modifier = Modifier, style: PieChartStyle = PieChartDefaults.style(), title: String? = null, selection: ChartSelection = rememberChartSelection(), interactionEnabled: Boolean = true, animateOnStart: Boolean = true)(source)

A composable function that displays a Pie Chart.

interactionEnabled disables all user controls (tap-to-select and the auto-deselect timeout), but programmatic selection still renders. animateOnStart controls the initial reveal, not subsequent update animations.

Parameters

data

The chart data to display. Each PieSlice renders as a slice with its own label, value, and optional color. Slices without a color fall back to shades generated from the style's base color.

modifier

The modifier to be applied to the chart. Also forwarded to the error branch when the data fails validation.

style

The style to be applied to the chart. If not provided, the default style will be used.

title

Optional chart title displayed when no slice is selected.

selection

The hoisted selection state. Use rememberChartSelection for interactive charts or io.github.hdcharts.charts.model.staticChartSelection for deterministic preset selections.

interactionEnabled

When false, disables tap-to-select and the auto-deselect timeout.

animateOnStart

When false, renders the chart in its final state without the initial reveal animation.