CartesianChartHost

fun CartesianChartHost(chart: CartesianChart, modelProducer: CartesianChartModelProducer, modifier: Modifier = Modifier, scrollState: VicoScrollState = rememberVicoScrollState(), zoomState: VicoZoomState = rememberDefaultVicoZoomState(scrollState.scrollEnabled), animationSpec: AnimationSpec<Float>? = defaultCartesianDiffAnimationSpec, initialAnimationSpec: AnimationSpec<Float>? = animationSpec, chartAreaHeight: Dp = Defaults.CARTESIAN_CHART_AREA_HEIGHT.dp, 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.

initialAnimationSpec

the AnimationSpec for the initial (reveal) animation. Defaults to animationSpec. Set to null to skip the initial animation.

chartAreaHeight

the default height of the coordinate system, to which the heights of the legend, the marker, and other components are added. Used only when the height isn’t otherwise constrained (e.g., via Modifier.height).

placeholder

shown when no CartesianChartModel is available.


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

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.

chartAreaHeight

the default height of the coordinate system, to which the heights of the legend, the marker, and other components are added. Used only when the height isn’t otherwise constrained (e.g., via Modifier.height).


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

Deprecated

Set `initialAnimationSpec` to `null` to skip the initial animation.

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.

animateIn

whether to run an initial animation when the CartesianChartHost enters composition. The animation is skipped for previews.

chartAreaHeight

the default height of the coordinate system, to which the heights of the legend, the marker, and other components are added. Used only when the height isn’t otherwise constrained (e.g., via Modifier.height).

placeholder

shown when no CartesianChartModel is available.