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.