CartesianChartHost

Overview

CartesianChartHostarrow-up-right is the entry point for Cartesian charts. It accepts a CartesianChart and a CartesianChartModelProducer, facilitates their communication, and displays the CartesianChart. It also handles scroll and zoom and shows a placeholder when no data is available.

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

Scroll

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

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

Scrollarrow-up-right, split into Scroll.Absolutearrow-up-right and Scroll.Relativearrow-up-right, is used to represent scroll values—either absolute (from zero) or relative (from the current value). 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 instances of VicoZoomStatearrow-up-right, enabling zoom customization. Use rememberVicoZoomStatearrow-up-right to instantiate this class:

Zoomarrow-up-right is used to define zoom factors. The following singletons and factory functions are available:

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

Last updated