Explain the baseline, band width and color order so compact time series remain decodable.
Horizon charts: trade vertical space for a harder value lookup
Folded bands need a key
A horizon chart divides a value's distance from a baseline into bands and overlays those bands in a short row. It can fit many series in little vertical space, but a reader must decode band color as well as vertical shape. State the baseline and numeric size of one band. If the chart shows deviations from 47 incidents per day, a value of 87 occupies two 20-unit bands above that reference, not 87 units of vertical height. Baseline integrity matters more when the display has been folded.
Positive and negative need separate meaning
For signed deviations, use distinguishable sequences for above and below the baseline, not just a lighter and darker tint of one hue. Include text labels for the sign and a small decoding key with concrete values. A monochrome or color-vision test should still allow readers to distinguish the two directions through texture, labels or a paired table. Accessible color alternatives are a requirement of the underlying comparison, not a finishing layer. Missing observations need a gap; they are not zero deviation.
Fix a common band domain
If each row chooses its own band width, the darkest color represents a different numeric amount in each series. That defeats cross-row comparison. Choose a shared band width and number of bands for all rows being compared, and decide how out-of-range values are signaled. Clipping an extreme silently is worse than showing an overflow marker and its numeric value. Extrema-preserving reduction helps keep short-lived spikes when a long series must be downsampled before folding.
Use compactness only when it helps
A horizon chart is suited to scanning many similarly scaled time series for timing and magnitude patterns. It is weak for exact readout, unfamiliar audiences and small numbers of series, where an ordinary line chart is easier. Keep a linked detail view or accessible table with timestamp, original value, baseline, signed deviation and band encoding. Small multiples are the natural comparison when there is enough vertical space. Document the folding rule in the export so future renders preserve the same visual thresholds.
Worked contract
from math import isfinite
def horizon_bands(value: float, baseline: float,
band_width: float, band_count: int
) -> tuple[str, list[float], bool]:
if not all(isfinite(number) for number in (value, baseline, band_width)):
raise ValueError("values must be finite")
if band_width <= 0 or not isinstance(band_count, int) or band_count < 1:
raise ValueError("positive band width and count required")
delta = value - baseline
remaining = abs(delta)
heights = []
for _ in range(band_count):
height = min(remaining, band_width)
heights.append(height)
remaining -= height
sign = "above" if delta > 0 else "below" if delta < 0 else "at"
return sign, heights, remaining > 0
assert horizon_bands(87, 47, 20, 3) == ("above", [20, 20, 0], False)
assert horizon_bands(18, 47, 20, 2) == ("below", [20, 9], False)
assert horizon_bands(130, 47, 20, 3)[2] is TruePerformance and operating cost
Encoding N observations with B bands takes O(NB) time and O(NB) output space when every band height is retained. The overflow flag prevents silent saturation but the rendering layer must draw a visible marker and numeric value. This function returns a sign and positive band heights; the renderer chooses color and clipping. Do not compare rows using different baselines or band widths unless the chart explicitly separates those views.
Common Mistakes
- Reading folded height as the full original value.
- Changing band width from row to row while reusing one color key.
- Letting values above the maximum band range saturate without an overflow label.
- Encoding missing as a zero deviation from baseline.
Validation drill
Display 59 equipment series around a shared service threshold. Check the band key against five exact values, mark overflows and offer a full-height line chart for one selected machine.
