BarChartDefaults

Defaults factory for BarChartStyle. All parameters have theme-aware defaults.

Properties

Link copied to clipboard

Default axis formatter, omitting only the terminal .0 on whole values.

Link copied to clipboard

Default formatter for chart value readouts.

Functions

Link copied to clipboard
fun axis(visible: Boolean = true, color: Color = androidx.compose.material3.MaterialTheme.colorScheme.onSurface .copy(alpha = 0.3f), lineWidth: Dp = with(LocalDensity.current) { 1f.toDp() }, xLabels: AxisLabelStyle = xLabels(), yLabels: AxisLabelStyle = yLabels()): BarAxisStyle

Returns a BarAxisStyle for axis and label configuration. The default stroke width preserves one physical pixel at the current density.

Link copied to clipboard
fun bars(color: Color = MaterialTheme.colorScheme.primary, colors: List<Color> = emptyList(), alpha: Float = defaultChartAlpha(), space: Dp = 10.dp, minBarWidth: Dp = 10.dp): BarBarsStyle

Returns a BarBarsStyle with bar-aware defaults.

Link copied to clipboard
fun grid(visible: Boolean = true, steps: Int = 4, color: Color = androidx.compose.material3.MaterialTheme.colorScheme.onSurface .copy(alpha = 0.15f), lineWidth: Dp = with(LocalDensity.current) { 1f.toDp() }): BarGridStyle

Returns a BarGridStyle for horizontal grid configuration. The default stroke width preserves one physical pixel at the current density.

Link copied to clipboard
fun range(min: Double? = null, max: Double? = null): BarRangeStyle

Returns a BarRangeStyle for the optional fixed Y-axis range.

Link copied to clipboard
fun selectionLine(visible: Boolean = true, color: Color = androidx.compose.material3.MaterialTheme.colorScheme.primary .copy(alpha = 0.6f), width: Dp = with(LocalDensity.current) { 1f.toDp() }): BarSelectionLineStyle

Returns a BarSelectionLineStyle for the selection indicator. The default stroke width preserves one physical pixel at the current density.

Link copied to clipboard
fun style(chartContainerStyle: ChartContainerStyle = ChartContainerDefaults.style(), bars: BarBarsStyle = bars(), range: BarRangeStyle = range(), grid: BarGridStyle = grid(), axis: BarAxisStyle = axis(), selectionLine: BarSelectionLineStyle = selectionLine(), zoomControlsVisible: Boolean = true): BarChartStyle

Returns a BarChartStyle with the provided parameters or their default values.

Link copied to clipboard
fun xLabels(visible: Boolean = true, color: Color = androidx.compose.material3.MaterialTheme.colorScheme.onSurface .copy(alpha = 0.75f), size: TextUnit = 11.sp, count: Int = 6): AxisLabelStyle

Returns an AxisLabelStyle for X-axis labels.

Link copied to clipboard
fun yLabels(visible: Boolean = true, color: Color = androidx.compose.material3.MaterialTheme.colorScheme.onSurface .copy(alpha = 0.75f), size: TextUnit = 11.sp, count: Int = 5): AxisLabelStyle

Returns an AxisLabelStyle for Y-axis labels.