Skip to main content

CamoLineChart

A chart of values over an ordered axis, as lines, areas or stacked areas, with a legend that toggles series, a tooltip and crosshair at the nearest category, and a data table. categories label the x axis (one per value); times (epoch milliseconds, ascending, timeZoneOffsetMinutes from UTC) places them on a time axis with calendar ticks instead. The plot is one image node whose text is title and each series' trend; focusing it walks the points (Left and Right between categories, Up and Down between series, Home and End) and announces "Jan, Sales, 42". A null value breaks the line; stacked areas treat negative values as zero. The time axis keeps its direction in a right-to-left layout, as time does.

API​

public fun CamoLineChart(
categories: List<String>,
series: List<ChartSeries>,
title: String,
modifier: Modifier = Modifier,
kind: LineKind = LineKind.Line,
curve: LineCurve = LineCurve.Linear,
markers: MarkerVisibility = MarkerVisibility.OnHover,
xAxis: ChartAxis = ChartAxis(),
yAxis: ChartAxis = ChartAxis(),
times: List<Long>? = null,
timeZoneOffsetMinutes: Int = 0,
loading: Boolean = false,
empty: (@Composable () -> Unit)? = null,
showTable: Boolean = false,
plotHeight: Dp = DefaultPlotHeight,
style: ChartStyle? = null,
)
NameTypeDefault
categoriesList<String>required
seriesList<ChartSeries>required
titleStringrequired
modifierModifierModifier
kindLineKindLineKind.Line
curveLineCurveLineCurve.Linear
markersMarkerVisibilityMarkerVisibility.OnHover
xAxisChartAxisChartAxis()
yAxisChartAxisChartAxis()
timesList<Long>?null
timeZoneOffsetMinutesInt0
loadingBooleanfalse
empty(@Composable () -> Unit)?null
showTableBooleanfalse
plotHeightDpDefaultPlotHeight
styleChartStyle?null
Design notes

Why CamoLineChart works this way, its states and its edge cases: contributor docs.