Line Chart
Show change over a continuous dimension — time, index, or ordered categories.
Use line charts when the story is about trend and rate of change, not category totals. Bind a shared Dataset via x_field and y_fields, or pass inline series and axis definitions for demos.
- Revenue, throughput, or KPI trends across months or quarters.
- Multiple series on one axis when metrics share the same x dimension.
- Threshold annotations via composition children such as
ReferenceLine.
- Bind a
Datasetwithx_fieldandy_fields, or pass inlineserieswith alignedx_axiscategories. - Set
show_markers: trueon series when points are sparse; useconnect_nullsto bridge missing values. - Inferred x-axes use
crate::DomainLimit::Strictby default — override viaAxisDef.domain_limit. - Leave
skip_animationunset to honor reduced-motion; path draw animation runs on enter/update otherwise. - Wrap the chart in a native element with
data-testidfor E2E hooks.
Compare two metrics that share the same time axis. Markers are off by default; set show_markers: true when sparse points need visible marks. Enable legend and tooltip (see cross-cutting previews) for exploration.
Missing values (f64::NAN or null dataset cells) break the stroke by default. Set connect_nulls: true on the series to bridge gaps — useful for sparse telemetry feeds.
Horizontal threshold via ReferenceLine composition child. Place the line after LinePlot so it renders above the stroke; use when targets or limits must stay visible on resize.