LineChartSection

fun LineChartSection(title: String, data: List<LineChartData>, contentDescriptionPrefix: String, emptyLabel: String, modifier: Modifier = Modifier, lineColor: Color = MaterialTheme.colorScheme.primary, fillColor: Color = MaterialTheme.colorScheme.primary.copy(alpha = 0.1f), pointColor: Color = MaterialTheme.colorScheme.primary, gridColor: Color = MaterialTheme.colorScheme.outlineVariant, chartHeight: Dp = DefaultStylishDimensions.lineChartHeight, strokeWidth: Dp = 2.5.dp, pointRadius: Dp = 4.dp, pointInnerRadius: Dp = 2.dp, labelTextSize: Dp = 10.dp, gridLineCount: Int = 5, maxLabelCount: Int = 6)

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

Use this on dashboard or summary screens to present time-series data (e.g. fuel efficiency trends) with a consistent heading style. Available on all platforms (commonMain).

Parameters

title

Section heading text rendered by the StylishSection header.

data

List of LineChartData points to plot. Each entry carries a label and a numeric value.

contentDescriptionPrefix

Leading text for the chart's combined accessibility description.

emptyLabel

Text displayed when data has fewer than two points, informing the user that no data is available.

modifier

Modifier applied to the section container.

lineColor

Stroke color of the connecting line. Defaults to MaterialTheme.colorScheme.primary.

fillColor

Semi-transparent color filling the area between the line and the X axis. Defaults to primary at 10 % alpha.

pointColor

Outer ring color of each data-point marker. 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.lineChartHeight.

strokeWidth

Thickness of the connecting line. Defaults to 2.5 dp.

pointRadius

Outer radius of each data-point circle. Defaults to 4 dp.

pointInnerRadius

Inner (surface-colored) radius of each data-point circle, creating a ring effect. Defaults to 2 dp.

labelTextSize

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

gridLineCount

Number of horizontal grid lines including top and bottom. Defaults to 5.

maxLabelCount

Maximum number of X-axis labels rendered. Labels are evenly sampled; the last data point's label is always included. Defaults to 6.

See also