Package-level declarations

Types

Link copied to clipboard
data class ChartData(val categories: ImmutableList<String>, val series: ImmutableList<ChartSeries>)

Immutable, indexed data shared by aligned-series charts.

Link copied to clipboard
class ChartSelection(initialIndex: Int? = null, onSelectionChanged: (Int?) -> Unit? = null)

Hoisted selection state for charts that support selecting a single data point (e.g. a pie slice).

Link copied to clipboard
data class ChartSeries(val name: String? = null, val values: ImmutableList<Double>)

A single named series of values within a ChartData.

Link copied to clipboard
fun interface ChartValueFormatter

Formats a raw chart value for display.

Link copied to clipboard

Standard ChartValueFormatter factories.

Link copied to clipboard
data class PieSlice(val label: String, val value: Double, val color: Color? = null)

A single slice of a pie chart.

Link copied to clipboard
sealed interface SelectionLifetime

Background lifecycle policy for a ChartSelection.

Functions

Link copied to clipboard
fun chartDataOf(categories: List<String> = emptyList(), vararg series: ChartSeries): ChartData

Builds a ChartData from shared categories and one or more series.

Link copied to clipboard
fun rememberChartSelection(initialIndex: Int? = null, onSelectionChanged: (Int?) -> Unit? = null): ChartSelection

Creates a ChartSelection remembered for the current composition.

Link copied to clipboard
fun rememberSelectionLifecycle(selection: ChartSelection, data: Any?, itemCount: Int = Int.MAX_VALUE, lifetime: SelectionLifetime = SelectionLifetime.Persistent, autoDeselectTrigger: Any? = selection.version)

Drives the background lifecycle of a ChartSelection:

Link copied to clipboard

Creates a new, unremembered ChartSelection initialized to index, e.g. for screenshots and documentation images. The returned state is still mutable; this factory does not lock selection or disable interaction or animation.

Link copied to clipboard
fun List<Pair<String, List<Double>>>.toChartData(categories: List<String> = emptyList()): ChartData

Builds multi-series ChartData from a list of named series.

fun List<Double>.toChartData(categories: List<String> = emptyList(), seriesName: String? = null): ChartData

Converts a list of values into single-series ChartData.