style

fun style(barColor: Color = MaterialTheme.colorScheme.primary, barAlpha: Float = defaultChartAlpha(), space: Dp = 10.dp, barColors: List<Color> = emptyList(), chartViewStyle: ChartViewStyle = ChartViewDefaults.style(), minBarWidth: Dp = 10.dp, zoomControlsVisible: Boolean = true, yAxisLabelsVisible: Boolean = true, yAxisLabelColor: Color = defaultYAxisLabelColor(), yAxisLabelSize: TextUnit = 11.sp, yAxisLabelCount: Int = 5, xAxisLabelsVisible: Boolean = true, xAxisLabelColor: Color = defaultXAxisLabelColor(), xAxisLabelSize: TextUnit = 11.sp, xAxisLabelMaxCount: Int = 6, selectionLineVisible: Boolean = true, selectionLineColor: Color = defaultSelectionLineColor(), selectionLineWidth: Float = 1.0f): StackedBarChartStyle

Returns a StackedBarChartStyle 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 bar segments. 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.

barColors

The colors to be used for the bars in the chart. Defaults to an empty list.

minBarWidth

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

zoomControlsVisible

Whether zoom controls are shown in expanded dense mode. Defaults to true.

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.

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 selection indicator line is shown. Defaults to true.

selectionLineColor

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

selectionLineWidth

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

chartViewStyle

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