style

fun style(barColor: Color = MaterialTheme.colorScheme.primary, barAlpha: Float = defaultChartAlpha(), space: Dp = 10.dp, minValue: Float? = null, maxValue: Float? = null, minBarWidth: Dp = 10.dp, zoomControlsVisible: Boolean = true, gridVisible: Boolean = true, gridSteps: Int = 4, gridColor: Color = defaultGridColor(), gridLineWidth: Float = 1.0f, axisVisible: Boolean = true, axisColor: Color = defaultAxisColor(), axisLineWidth: Float = 1.0f, xAxisLabelsVisible: Boolean = true, xAxisLabelColor: Color = defaultXAxisLabelColor(), xAxisLabelSize: TextUnit = 11.sp, xAxisLabelMaxCount: Int = 6, selectionLineVisible: Boolean = true, selectionLineColor: Color = defaultSelectionLineColor(), selectionLineWidth: Float = 1.0f, chartViewStyle: ChartViewStyle = ChartViewDefaults.style(), yAxisLabelsVisible: Boolean = true, yAxisLabelColor: Color = defaultYAxisLabelColor(), yAxisLabelSize: TextUnit = 11.sp, yAxisLabelCount: Int = 5): BarChartStyle

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

Parameters

barColor

The color to be used for the bars in the chart. Defaults to the primary color of the MaterialTheme.

barAlpha

The alpha value applied to rendered bars. Defaults to 0.4f in light theme and 0.6f in dark theme.

space

The space between the bars in the chart. Defaults to 10.dp.

minValue

Optional fixed minimum value for the chart scale. Defaults to null.

maxValue

Optional fixed maximum value for the chart scale. Defaults to null.

minBarWidth

The minimum width of each bar. Defaults to 10.dp.

zoomControlsVisible

Whether zoom controls are shown. Defaults to true.

gridVisible

Whether horizontal grid lines are shown. Defaults to true.

gridSteps

Number of horizontal grid intervals. Defaults to 4.

gridColor

The color of grid lines. Defaults to a theme-based onSurface variant.

gridLineWidth

The stroke width of grid lines. Defaults to 1f.

axisVisible

Whether the left Y-axis line and horizontal baseline are shown. Defaults to true.

axisColor

The color of the axes. Defaults to a theme-based onSurface variant.

axisLineWidth

The stroke width of the axes. Defaults to 1f.

xAxisLabelsVisible

Whether X-axis labels are shown. Defaults to true.

xAxisLabelColor

The color of X-axis labels. Defaults to a theme-based onSurface variant.

xAxisLabelSize

The text size of X-axis labels. Defaults to 11.sp.

xAxisLabelMaxCount

Maximum number of X-axis labels to display. Defaults to 6.

selectionLineVisible

Whether the selected bar indicator line is shown. Defaults to true.

selectionLineColor

The color of the selected bar indicator line. Defaults to a theme-based primary variant.

selectionLineWidth

The stroke width of the selected bar indicator line. Defaults to 1f.

chartViewStyle

The style to be applied to the chart view. Defaults to the default style of ChartViewDefaults.

yAxisLabelsVisible

Whether Y-axis labels are shown. Defaults to true.

yAxisLabelColor

The color of Y-axis labels. Defaults to a theme-based onSurface variant.

yAxisLabelSize

The text size of Y-axis labels. Defaults to 11.sp.

yAxisLabelCount

Number of Y-axis labels. Defaults to 5.