BarChartSection

fun BarChartSection(title: String, data: List<BarChartData>, contentDescriptionPrefix: String, emptyLabel: String, modifier: Modifier = Modifier, barColor: Color = MaterialTheme.colorScheme.primary, gridColor: Color = MaterialTheme.colorScheme.outlineVariant, chartHeight: Dp = DefaultStylishDimensions.barChartHeight, topRadius: Dp = 4.dp, labelTextSize: Dp = 10.dp, gridLineCount: Int = 4)

A page section that pairs a StylishSection heading with a SimpleBarChart.

Use this on dashboard or summary screens to present categorical data (e.g. monthly expenses) with a consistent heading style. Available on all platforms (commonMain).

Parameters

title

Section heading text rendered by the StylishSection header.

data

List of BarChartData points to plot. Each entry carries a label, a numeric value, and an optional segments list for stacked bars.

contentDescriptionPrefix

Leading text for the chart's combined accessibility description.

emptyLabel

Text displayed when data is empty, informing the user that no data is available.

modifier

Modifier applied to the section container.

barColor

Fill color for single-color (non-stacked) bars. Defaults to MaterialTheme.colorScheme.primary.

gridColor

Color of horizontal grid lines. Defaults to MaterialTheme.colorScheme.outlineVariant.

chartHeight

Total height of the chart area. Defaults to DefaultStylishDimensions.barChartHeight.

topRadius

Corner radius applied to the top of each bar (or the topmost segment in stacked mode). Defaults to 4 dp.

labelTextSize

Text size for axis and category labels. Defaults to 10 dp.

gridLineCount

Number of horizontal grid lines including the baseline. Defaults to 4.

See also