VerticalBarChart

fun <X, Y, E : BarChartEntry<X, Y>> XYChartScope<X, Y>.VerticalBarChart(series: List<List<E>>, modifier: Modifier = Modifier, bar: VerticalBarComposable<E> = { i, _, _ -> val colors = remember(series.size) { generateHueColorPalette(series.size) } DefaultVerticalBar( brush = SolidColor(colors[i]), modifier = Modifier.fillMaxWidth(KoalaPlotTheme.sizes.barWidth) ) }, stacked: Boolean = false, maxBarGroupWidth: Float = 0.9f, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

Deprecated

Replace with either GroupedVerticalBarPlot, VerticalBarPlot, or StackedVerticalBarPlot

A VerticalBarChart to be used in an XYChart and that can plot multiple series either side-by-side or stacked as a stacked bar chart.

Parameters

X

The type of the x-axis values

Y

The type of the y-axis values

E

The type of the data element holding the values for each bar

series

Bar elements where the outer list contains each series of multiple items. The BarChartEntry's xValues should be equal for entries at the same index within each series.

bar

Composable function to emit a bar for each data element, see VerticalBarComposable.

stacked

If false, bars from the same index position in each series will be laid out side-by-side occupying the space available between adjacent x-axis values. If true, bars from the same index position in each series will be laid out centered on the x-axis value. The yMin and yMax values for each entry are used to define the vertical positioning of each bar, therefore this function can be used to render multiple stacked bar styles depending on their values.

maxBarGroupWidth

The fraction of space between adjacent x-axis bars or bar groups that may be used. Must be between 0 and 1, defaults to 0.9.