Baseline chart
Area chart split by a horizontal reference line — fill above the baseline in one colour (profit), below in another (loss). Common for diff series, deviation-from-target, gains-vs-losses.
The demo plots the US Federal Funds Rate, 1965–1985, baselined against the long-run 5 % anchor most macro texts use when discussing the Volcker disinflation. The visible spikes above the baseline track the late-60s Vietnam-era overheating, the post-oil-shock inflation, and the Volcker shock of 1979–82 that crushed double-digit inflation by taking the funds rate above 16 % — a peak you can read straight off the 1981 fill.
Source: Federal funds rate — Wikipedia
Public surface
use wisp_chart::baseline::BaselineChart;
let bc = BaselineChart::new(
vec![(0.0, 10.0), (1.0, 25.0), (2.0, -10.0), (3.0, 15.0)],
0.0, // baseline y-value
);
let g = bc.emit_graphics(&theme, Vec2::new(480.0, 240.0));