BarChart

fun BarChart(data: ChartData, modifier: Modifier = Modifier, style: BarChartStyle = BarChartDefaults.style(), title: String? = null, selection: ChartSelection = rememberChartSelection(), interactionEnabled: Boolean = true, animateOnStart: Boolean = true, valueFormatter: ChartValueFormatter = BarChartDefaults.valueFormatter, axisValueFormatter: ChartValueFormatter = BarChartDefaults.axisValueFormatter)(source)

Displays one indexed series of finite Double values as vertical bars.

modifier applies to both the chart and validation errors. title is optional and independent of category labels. Empty categories hide X labels; selected readouts then show only the formatted value. selection always identifies a source bar, including when compact mode displays bucket averages. Tapping a bucket selects its middle source bar; selecting the same bucket again clears selection.

Replacing data clears selection; resizing or changing density does not. Disabling interactionEnabled disables all user controls, but programmatic selection still renders. animateOnStart controls initial reveal, not subsequent update animations. valueFormatter formats selected raw values; axisValueFormatter formats Y ticks.