CartesianChartHost

CartesianChartHostarrow-up-right is the entry point for Cartesian charts. It accepts CartesianChartarrow-up-right and CartesianChartModelProducerarrow-up-right instances, facilitates communication between them, and displays the chart. It also handles scroll and zoom and shows a placeholder when no data is available.

CartesianChartHost(rememberCartesianChart(/* ... */), modelProducer, /* ... */)

Scroll

CartesianChartHost accepts VicoScrollStatearrow-up-right instances, enabling scroll customization and programmatic scrolling. Use rememberVicoScrollStatearrow-up-right to instantiate VicoScrollState:

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

Scrollarrow-up-right represents scroll values—either absolute (from zero) or relative (from the current value). Scroll.Absolutearrow-up-right and Scroll.Relativearrow-up-right cover the two cases. The following factory functions are available:

AutoScrollConditionarrow-up-right defines when to scroll automatically. There are two singletons:

You can create custom implementations of Scroll and AutoScrollCondition for more specific behavior.

Zoom

CartesianChartHost accepts VicoZoomStatearrow-up-right instances, enabling zoom customization. Use rememberVicoZoomStatearrow-up-right to instantiate VicoZoomState:

Zoomarrow-up-right defines zoom factors. The following singletons and factory functions are available:

You can create custom implementations of Zoom for more specific behavior.

Last updated