Skip to content

Line Chart ​

Trends over categories; monotone ("natural"), linear or step curves.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Linear with dots ​

Approximate web preview — the HarmonyOS rendering is the reference.

Step ​

Approximate web preview — the HarmonyOS rendering is the reference.

Multiple ​

Several series, value axis, legend (tap to toggle).

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SLineChart ​

shadcn "Line Chart": one line per series of config, categories from data rows.

Hover (pointer), tap or pan horizontally to show the crosshair and tooltip.

PropTypeDefaultDescription
configSparkChartConfignew SparkChartConfig([])
dataSparkChartRow[][]
chartHeightnumber0height in vp; 0 → responsive 16:9 of the measured width (160–320)
curveSparkChartCurve
SparkChartCurve = 'linear' | 'monotone' | 'step'
'monotone''monotone' (shadcn "natural"), 'linear' or 'step'
dotsbooleanfalse
lineWidthnumber2
gridbooleantrue
categoryAxisbooleantruecategory labels (x axis)
valueAxisbooleanfalsevalue ticks (y axis)
tooltipbooleantrue
legendbooleanfalse
indicatorSparkChartIndicator
SparkChartIndicator = 'dot' | 'line' | 'dashed'
'line'
labelFormatter(label: string) => stringidentityLabel
valueFormatter(value: number) => stringdefaultValue
emptyTextResourceStr$r('app.string.spark_no_data')
EventTypeDefaultDescription
onActiveChange(index: number) => void() => { }

MIT Licensed