Skip to content

Sparkline

A compact, single-row history graph of recent numeric values, rendered with the eight vertical block elements (▁▂▃▄▅▆▇█).

See also: LineChart for axes, legends, and several series.

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

Sparkline(data: const <num>[3, 5, 4, 8, 6, 9, 7])

Right-aligned (newest value on the right); values older than the available width are dropped from the left. Sized by the parent — a row that fills its width by default, or wrap in SizedBox for an explicit width.

Screen readers and agents get one chart node: semanticLabel with the latest value, plus the point count, min, and max (or, when max is null, the largest value in data).

ParameterTypeDefaultDescription
data:List<num>requiredThe series of values to plot. The newest value goes on the right.
max:num?—Top of the visible range. null autoscales to the data window.
min:num0Baseline value. Defaults to 0.
color:Color?—Foreground color override; defaults to the theme’s primary.
style:CellStyle?—Full style override; takes precedence over color.
showValue:boolfalseWhen true, append the latest value as muted text to the right of the sparkline — a shape alone doesn’t convey magnitude.
semanticLabel:String'Sparkline'Label exposed through the semantic app graph.

Sparkline is defined in packages/fleury/lib/src/catalog/sparkline.dart.

Category: Charts & meters · All widgets