BarChartData

data class BarChartData(val label: String, val value: Float, val segments: List<BarChartSegment> = emptyList())

Data for a single bar (category) in a SimpleBarChart.

When segments is empty the bar is drawn as a single solid rectangle using the chart-level barColor. When segments are provided, each segment is drawn in its own color; the total visual height equals the sum of segment values. Callers should ensure segments sum to value for consistent scaling with non-stacked bars.

See also

Constructors

Link copied to clipboard
constructor(label: String, value: Float, segments: List<BarChartSegment> = emptyList())

Properties

Link copied to clipboard

Category name rendered below the bar on the X axis and included in the accessibility description.

Link copied to clipboard

Optional stacked sub-divisions. When non-empty, each BarChartSegment is drawn in order from the base upward. Defaults to an empty list (single-color bar).

Link copied to clipboard

Total magnitude that determines the bar's height relative to the chart's maximum value. Negative or non-finite values render as a zero-height bar; the accessibility description always shows the original value.