StackedHorizontalBarPlot

fun <X, Y, E : HorizontalBarPlotStackedPointEntry<X, Y>> XYGraphScope<X, Y>.StackedHorizontalBarPlot(data: List<E>, modifier: Modifier = Modifier, bar: DefaultHorizontalBarComposable<X, Y>, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ))

Composes a stacked horizontal bar plot. This is a convenience method which defers to HorizontalBarPlot. A stacked bar plot can be also achieved by placing multiple HorizontalBarPlots on an io.github.koalaplot.core.xygraph.XYGraph, one for each "layer" of bars.

Parameters

data

A List of BarPlotStackedPointEntry data points to plot.

bar

A Composable function to render each bar. yIndex is the index into the data List, barIndex corresponds to the index provided to HorizontalBarPlotStackedPointEntry.x, and point is the data point from data.


fun <Y> XYGraphScope<Float, Y>.StackedHorizontalBarPlot(modifier: Modifier = Modifier, barWidth: Float = 0.9f, startAnimationUseCase: StartAnimationUseCase = StartAnimationUseCase( executionType = StartAnimationUseCase.ExecutionType.Default, /* chart animation */ KoalaPlotTheme.animationSpec, ), content: StackedHorizontalBarPlotScope<Float, Y>.() -> Unit)

A Horizontal Bar Plot to be used in an XYGraph and that plots multiple series as a stack of bars.

Parameters

Y

The type of the x-axis values

barWidth

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

content

A block which describes the content for the plot.