Line Charts
Signature
sp.line(title, labels=None, values=None, *, variant="basic", series=None, **kwargs) -> Chart
Description
sp.line() is the unified entry point for the entire line-chart family. The variant keyword selects the rendering strategy — every other argument is shared across variants.
Variants
Parameters
Returns
Chart — object with .html property and .show() method.
Single series connecting ordered data points.
Several series sharing the same x-axis. Pass series=[(name, values), ...].
Step (staircase) line — ideal for piecewise-constant data. Use step_shape to control corner direction.
Catmull-Rom smoothed curve. spline_tension (0–1) controls how tight the curve hugs the points.
Area chart — fills the region under the line. fill_opacity controls transparency; stack_fill=True stacks multiple series.
Small inline chart — no axes, perfect for dashboards. spark_cols arranges multiple series in a grid.
Custom stroke pattern. dash_pattern="8,4" means 8px on, 4px off. Use "2,3" for dotted.
Line plot with prominent markers. marker_size (px) controls dot size; show_points=True is implicit.
Line breaks where values exceed gap_threshold. Useful for time series with missing samples.
Line + confidence/forecast band fusion: pass series as low/high pairs ([group1_low, group1_high, group2_low, group2_high, ...]) instead of single traces. Each group gets a shaded area between its two bounds, thin dashed edge lines, and a solid midline with markers — a forecast interval, min/max envelope or confidence band, natively.
Each segment is colored on a diverging scale by its own local slope, with a matching soft gradient fill beneath, automatic peak/trough callouts, and a glowing pulse on the latest point — momentum, read at a glance instead of computed by eye.
Auto-segments the series into narrative chapters at its own significant turning points, shades each by net direction, and captions it with a plain-language badge — the chart writes its own headline instead of asking the reader to compute one. epoch_pos_color / epoch_neg_color / epoch_flat_color (hex ints) recolor the rising/falling/flat chapters.
Compares the series against its own ideal glidepath to a pace_target, shading ahead-of-pace and behind-of-pace stretches in different colors, then extrapolates the recent trend past the last real point to project whether it clears the target. pace_ahead_color / pace_behind_color recolor the comparison.