item

abstract fun item(value: Float, key: Any? = null, label: @Composable () -> Unit = {}, connector: @Composable LabelConnectorScope.() -> Unit = { StraightLineConnector() }, slice: @Composable PieSliceScope.() -> Unit? = null)

Adds an item to the PieChart.

Parameters

value

The numerical value of the slice. The slice's angular extent will be proportional to this value relative to the sum of all values in the chart.

key

A stable, unique key representing this item. Using stable keys ensures that animations (like value transitions and initial grow) work correctly when items are added, removed, or updated. Defaults to the item's index.

label

Composable for the slice label.

connector

Composable for the label connector. Defaults to StraightLineConnector.

slice

Composable to customize the slice appearance. If null, a DefaultSlice with an automatically generated color will be used.