Vega-Lite Slope Chart
A slope chart — two parallel y-axes with a line for every entity connecting its 'before' value to its 'after' value, sorted by the change. The visual is the cleanest possible read of WHO went up vs down between two time points, without the visual noise of a full time series. Vega
Template details
- chart
- slope
- comparison
- before-after
- vega
- vega-lite
When to use this template
A slope chart excels at revealing the magnitude and direction of change for multiple entities between two distinct points in time. It quickly highlights which entities experienced the largest gains, losses, or remained stable, making it ideal for comparing performance shifts without the clutter of intermediate data points. Analysts use it to pinpoint outliers and understand relative changes across a cohort.
- Data with exactly two distinct comparison points (e.g., 'before' and 'after').
- Multiple individual entities (10s to 100s) requiring comparison.
- A single quantitative metric measured for each entity at both points.
- Long-format data where each row represents an entity at a time point.
- When the primary insight is the direction and magnitude of change per entity.
- To identify entities with significant rank shifts or stability between points.