Vico

5.1. Starter examples

5.1.1. Column chart

val modelProducer = remember { CartesianChartModelProducer() }
LaunchedEffect(Unit) {
    modelProducer.runTransaction { columnSeries { series(4, 12, 8, 16) } }
}
CartesianChartHost(
    rememberCartesianChart(
        rememberColumnCartesianLayer(),
        startAxis = rememberStartAxis(),
        bottomAxis = rememberBottomAxis(),
    ),
    modelProducer,
)

5.1.2. Line chart

val modelProducer = remember { CartesianChartModelProducer() }
LaunchedEffect(Unit) {
    modelProducer.runTransaction { lineSeries { series(4, 12, 8, 16) } }
}
CartesianChartHost(
    rememberCartesianChart(
        rememberLineCartesianLayer(),
        startAxis = rememberStartAxis(),
        bottomAxis = rememberBottomAxis(),
    ),
    modelProducer,
)

5.1.3. More

Refer to the sample app—see “Sample app” under “Learning resources” in the preface.