CartesianChartHost

fun CartesianChartHost(chart: CartesianChart, modelProducer: CartesianChartModelProducer, modifier: Modifier = Modifier, scrollState: VicoScrollState = rememberVicoScrollState(), zoomState: VicoZoomState = rememberDefaultVicoZoomState(scrollState.scrollEnabled), animationSpec: AnimationSpec<Float>? = defaultCartesianDiffAnimationSpec, runInitialAnimation: Boolean = true, placeholder: @Composable BoxScope.() -> Unit = {})

Displays a CartesianChart.

Parameters

chart
modelProducer

creates and updates the CartesianChartModel.

modifier

the modifier to be applied to the chart.

scrollState

houses information on the CartesianChart’s scroll value. Allows for scroll customization and programmatic scrolling.

zoomState

houses information on the CartesianChart’s zoom factor. Allows for zoom customization.

animationSpec

the AnimationSpec for difference animations.

runInitialAnimation

whether to display an animation when the chart is created. In this animation, the value of each chart entry is animated from zero to the actual value. This animation isn’t run in previews.

placeholder

shown when no CartesianChartModel is available.


fun CartesianChartHost(chart: CartesianChart, model: CartesianChartModel, modifier: Modifier = Modifier, scrollState: VicoScrollState = rememberVicoScrollState(), zoomState: VicoZoomState = rememberDefaultVicoZoomState(scrollState.scrollEnabled))

Displays a CartesianChart. This function accepts a CartesianChartModel. For dynamic data, use the function overload that accepts a CartesianChartModelProducer instance.

Parameters

chart
modifier

the modifier to be applied to the chart.

scrollState

houses information on the CartesianChart’s scroll value. Allows for scroll customization and programmatic scrolling.

zoomState

houses information on the CartesianChart’s zoom factor. Allows for zoom customization.