Starter examples

Column chart

The following has been adapted from the “Basic column chart”arrow-up-right sample chart.

val modelProducer = remember { CartesianChartModelProducer() }
LaunchedEffect(Unit) {
    modelProducer.runTransaction {
        columnSeries { series(5, 6, 5, 2, 11, 8, 5, 2, 15, 11, 8, 13, 12, 10, 2, 7) }
    }
}
CartesianChartHost(
    rememberCartesianChart(
        rememberColumnCartesianLayer(),
        startAxis = VerticalAxis.rememberStart(),
        bottomAxis = HorizontalAxis.rememberBottom(),
    ),
    modelProducer,
)

Line chart

The following has been adapted from the “Basic line chart”arrow-up-right sample chart.

More

For more examples, refer to the sample app.

Last updated