Vico

5.2. CartesianChart

5.2.1. Host

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

5.2.2. Creation

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

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

5.2.3. 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, /* ... */)