The guide is being migrated; some links to the API reference may be missing. Use the search bar in the API reference.

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