Bar Chart
fun BarChart(data: () -> List<BarData>, modifier: Modifier = Modifier, target: Float? = null, targetConfig: TargetConfig = TargetConfig.default(), barChartConfig: BarChartConfig = BarChartConfig.default(), labelConfig: LabelConfig = LabelConfig.default(), barTooltip: BarTooltip? = null, barChartColorConfig: BarChartColorConfig = BarChartColorConfig.default(), onBarClick: (Int, BarData) -> Unit = { _, _ -> })
A composable function that displays a bar chart.
Parameters
data
A lambda function that returns a list of BarData
representing the data points for the bar chart.
modifier
A Modifier
for customizing the layout or drawing behavior of the chart.
target
An optional target value to be displayed on the chart.
target Config
A TargetConfig
object for configuring the appearance of the target line.
bar Chart Config
A BarChartConfig
object for configuring the chart's appearance and behavior.
label Config
A LabelConfig
object for configuring the labels on the chart.
bar Chart Color Config
A BarChartColorConfig
object for configuring the colors of the bars, axis lines, and grid lines.
on Bar Click
A lambda function to handle click events on the bars. It receives the index of the clicked bar and the corresponding BarData
as parameters.