Zone background

Filled horizontal bands behind chart data based on training zones (e.g. Coggan power zones). Place before ChartLine in JSX.

Primitive: ChartZoneBackground

Interactive demo

Usage

import { ChartRoot, ChartZoneBackground, ChartLine, POWER_ZONES } from '@ramtt/charts'

<ChartRoot data={data} height={200}>
  <ChartZoneBackground threshold={240} zones={POWER_ZONES} showLabels />
  <ChartLine />
</ChartRoot>

Props

PropTypeDefaultDescription
threshold*numberThreshold value (e.g. FTP in watts) — zones are computed as fractions of this
zonesZoneDefinition[]Zone definitions (default: Coggan POWER_ZONES)
opacitynumber0.06Fill opacity for zone bands
showLabelsbooleanfalseShow zone labels on the right edge
classNamestringAdditional Tailwind classes