PieSlice

data class PieSlice(val label: String, val value: Double, val color: Color? = null)(source)

A single slice of a pie chart.

Each PieSlice is a self-contained entity carrying its own label, value, and optional color. Providing the color on the slice (rather than as a separate style list) makes it impossible to supply a color count that does not match the slice count.

Parameters

label

The slice label, shown in the legend and while the slice is selected.

value

The slice value. The rendered arc is proportional to this value. Values are Double so callers can mix large totals with tiny contributions without rounding loss. Finite numbers are required; NaN, +Infinity, and -Infinity are rejected by validation.

color

The slice color. When null, a shade is generated from the style's base color.

Constructors

Link copied to clipboard
constructor(label: String, value: Double, color: Color? = null)

Properties

Link copied to clipboard
val color: Color?
Link copied to clipboard
Link copied to clipboard