BarBarsStyle

data class BarBarsStyle(val color: Color, val colors: ImmutableList<Color>, val gradient: ChartGradient?, val alpha: Float, val space: Dp, val minBarWidth: Dp)(source)

Bar visual configuration shared by vertical bar and histogram charts.

Constructors

Link copied to clipboard
constructor(color: Color, colors: ImmutableList<Color>, gradient: ChartGradient?, alpha: Float, space: Dp, minBarWidth: Dp)
constructor(color: Color, colors: List<Color>, gradient: ChartGradient?, alpha: Float, space: Dp, minBarWidth: Dp)

Copies colors into an immutable palette. Use an immutable list with copy.

Properties

Link copied to clipboard

The alpha value applied to rendered bars. Replaces the source color alpha, and multiplies a gradient's own alphas.

Link copied to clipboard

The fallback bar color when colors is empty.

Link copied to clipboard
val colors: ImmutableList<Color>

Optional explicit per-bar colors. Empty means every bar uses color; non-empty must match the source bar count.

Link copied to clipboard

Optional gradient that paints the bars. Its span picks one gradient per bar or one across the plot. Null draws solid bars.

Link copied to clipboard

The minimum width of each bar.

Link copied to clipboard
val space: Dp

The spacing between bars.

Functions

Link copied to clipboard
fun resolveColors(barCount: Int): ImmutableList<Color>

Returns the bar colors the chart draws for barCount bars, before alpha is applied: colors when set, or color for every bar when colors is empty.