Skip to main content

CamoBarChart

Bars comparing values across categories: vertical or horizontal, grouped side by side or stacked, with a legend that toggles series, a tooltip on the bar under the pointer and a data table. yAxis is always the value axis and xAxis the category axis, whichever way the bars run. valueLabels writes each bar's value at its free end (a stack's total at its end). The plot is one image node; focusing it walks the bars (Left and Right between categories, Up and Down between series) and announces "Q1, North, 42". Bars grow from zero; negative bars go the other way. In a right-to-left layout vertical bars run from the right and horizontal bars start at the right edge.

API​

public fun CamoBarChart(
categories: List<String>,
series: List<ChartSeries>,
title: String,
modifier: Modifier = Modifier,
orientation: BarOrientation = BarOrientation.Vertical,
mode: BarMode = BarMode.Grouped,
valueLabels: Boolean = false,
xAxis: ChartAxis = ChartAxis(),
yAxis: ChartAxis = ChartAxis(),
loading: Boolean = false,
empty: (@Composable () -> Unit)? = null,
showTable: Boolean = false,
plotHeight: Dp = DefaultBarPlotHeight,
style: ChartStyle? = null,
)
NameTypeDefault
categoriesList<String>required
seriesList<ChartSeries>required
titleStringrequired
modifierModifierModifier
orientationBarOrientationBarOrientation.Vertical
modeBarModeBarMode.Grouped
valueLabelsBooleanfalse
xAxisChartAxisChartAxis()
yAxisChartAxisChartAxis()
loadingBooleanfalse
empty(@Composable () -> Unit)?null
showTableBooleanfalse
plotHeightDpDefaultBarPlotHeight
styleChartStyle?null
Design notes

Why CamoBarChart works this way, its states and its edge cases: contributor docs.