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
- Kotlin
- Dart
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,
)
| Name | Type | Default |
|---|---|---|
categories | List<String> | required |
series | List<ChartSeries> | required |
title | String | required |
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 |
Design notes
Why CamoBarChart works this way, its states and its edge cases: contributor docs.