Package-level declarations

Types

Link copied to clipboard

Theme-aware style factories and default value formatters for LineChartStyle.

Link copied to clipboard
class LineChartStyle(val chartContainerStyle: ChartContainerStyle, val line: LineVisualStyle, val points: LinePointStyle, val selection: LineSelectionStyle, val axes: AxesStyle, val range: LineRangeStyle, val legend: LegendStyle, val zoomControlsVisible: Boolean)

Presentation for single- and multi-line charts.

Link copied to clipboard
data class LinePointStyle(val color: Color, val size: Dp, val visible: Boolean)

Markers drawn at the source points of each line.

Link copied to clipboard
data class LineRangeStyle(val min: Double?, val max: Double?)

Optional fixed Y-axis range for line charts.

Link copied to clipboard
data class LineSelectionStyle(val visible: Boolean, val color: Color, val width: Dp, val markerColor: Color, val markerSize: Dp, val pointSize: Dp)

Selection configuration for line charts.

Link copied to clipboard
data class LineVisualStyle(val color: Color, val alpha: Float, val colors: ImmutableList<Color>, val strokeWidth: Dp, val bezier: Boolean, val gradient: ChartGradient?)

Style of the series lines.

Functions

Link copied to clipboard
fun LineChart(data: ChartData, modifier: Modifier = Modifier, style: LineChartStyle = LineChartDefaults.style(), title: String? = null, selection: ChartSelection = rememberChartSelection(), interactionEnabled: Boolean = true, animateOnStart: Boolean = true, selectedValueFormatter: ChartValueFormatter = LineChartDefaults.selectedValueFormatter, axisValueFormatter: ChartValueFormatter = LineChartDefaults.axisValueFormatter, subtitle: String? = null)

Displays one or more aligned indexed series. A single public entry point handles both single- and multi-line data. Selection always refers to a source X index shared by all series. In compact mode, user interaction selects the middle source index represented by a bucket; programmatic source selection highlights the bucket containing that index.

Link copied to clipboard
fun LiveLineChart(data: ChartData, modifier: Modifier = Modifier, style: LineChartStyle = LineChartDefaults.style(), title: String? = null, shiftDuration: Duration = 420.milliseconds, animateOnStart: Boolean = true, axisValueFormatter: ChartValueFormatter = LineChartDefaults.axisValueFormatter, subtitle: String? = null)

Displays a live window of one or more aligned indexed series. When data drops its oldest point and appends a new one, the line slides one step to the left, X-axis labels stay on their points and slide with them, and the Y axis rescales to the current window. Other changes that keep the number of points and series morph the line over shiftDuration; changes to either count redraw immediately.