CartesianChartImage

@Composable
fun CartesianChartImage(chart: CartesianChart, model: CartesianChartModel, contentDescription: String?, modifier: GlanceModifier = GlanceModifier, size: DpSize = LocalSize.current, contentScale: ContentScale = ContentScale.Fit)

Displays a CartesianChart as a static image in a Glance app widget.

The chart is rendered off-screen to a bitmap and displayed via Glance’s Image. Since Glance doesn’t support Compose Canvas, this is the recommended approach for showing charts in widgets.

Parameters

chart
contentDescription

the content description for accessibility.

modifier

the GlanceModifier to be applied.

size

the desired chart size. Defaults to the widget size provided by Glance’s LocalSize.

contentScale

how the chart image should be scaled within its bounds.