Skip to main content

Module chart

Module chart 

Expand description

Time-series charts — Chart (a full line/area plot with grid lines, axis ticks and a legend) and Sparkline (a compact, chromeless variant for inline trend cells).

Both render one or more Series of f32 samples. A series is mapped to pixels with the standard time-series projection: the samples are evenly spaced across the plot width and scaled against a shared max so multiple series share a vertical axis. The top edge of each series is a stroked polyline; with Chart::with_area an optional translucent area fill is dropped from the line down to the baseline.

Colours come entirely from the Theme: grid lines from the standard border colour, axis tick labels from the dim text colour, and each series carries its own Series::color (callers typically pull these from the theme accent / semantic ramps). Nothing is hard-coded.

Structs§

Chart
Full time-series line/area chart with grid, axis ticks and a legend.
ChartLabels
The text a Chart paints around its plot. Any of them may be empty.
ChartStyle
Grid, header and series styling for a Chart.
RollingSeries
A fixed-capacity rolling window of samples — the store behind a live, streaming chart or sparkline. Once full, every push drops the oldest sample, so as_slice always reads oldest → newest and can be handed straight to Series or Sparkline::paint.
Series
One labelled data series. data is sampled left-to-right across the plot; color is the line/area tint; legend is the label shown in the chart’s legend strip (empty string = omit from the legend).
Sparkline
Compact, chromeless trend line — no axis, grid, title or legend. Just the area fill + line, sized to fill its rect. Drop one into a table cell or a stat card to show a recent trend.
TrendRange
The value interval a trend maps onto its plot’s height: lo lands on the baseline, hi on the top edge, and values outside clamp to the plot.
TrendStyle
Paint options for a trend line — the one line/area renderer behind Sparkline and every series of a Chart.

Enums§

TrendCurve
How consecutive samples are joined.
TrendFill
How the area under a trend line is filled.