Vico
Vico 2.1.0 (in alpha) adds Compose Multiplatform support. Switch guide versions.

CartesianChart

Host

The CartesianChart host for Jetpack Compose is the CartesianChartHost composable function.

Creation

Instantiate CartesianChart via rememberCartesianChart, whose parameters match those of the CartesianChart constructor:

CartesianChartHost(chart = rememberCartesianChart(/* ... */), /* ... */)

Scroll and zoom

CartesianChartHost accepts instances of VicoScrollState and VicoZoomState. Use rememberVicoScrollState and rememberVicoZoomState to instantiate these classes:

val scrollState = rememberVicoScrollState(/* ... */)
val zoomState = rememberVicoZoomState(/* ... */)
CartesianChartHost(scrollState = scrollState, zoomState = zoomState, /* ... */)