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.

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

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.

fun <T> List<T>.toChartData(value: (T) -> Double, category: (T) -> String, seriesName: String? = null): ChartData

Converts a list of domain objects into single-series ChartData.