Trend · Advanced

Horizon chart

Many time series in thin rows, each value folded into a few colored bands.

Open in playground
Use when
13 to 60 time series in the same unit on one card
Avoid when
12 or fewer series (a line chart or small multiples read faster), or first-time readers have no time to read the legend

Try it

47

Horizon chart

Year-over-year change in weekly requests by service (%)
Horizon chartHorizon chart. 12 series, 26 points each, 2 bands of 10%. Largest last value: checkout 20.7%. Smallest: support -20.7%.checkout20.7%search17.3%cart12.1%login3.5%signup9.2%orders9.2%reviews6.4%coupons-8.9%wishlist-8.9%shipping0%support-20.7%notifications1.1%
Horizon chart data
checkoutlatest 20.7%, min 6.6%, max 20.7%
searchlatest 17.3%, min 9.1%, max 19%
cartlatest 12.1%, min 2.8%, max 12.1%
loginlatest 3.5%, min -4.4%, max 5%
signuplatest 9.2%, min -1.6%, max 10.9%
orderslatest 9.2%, min 3.3%, max 9.8%
reviewslatest 6.4%, min -1.5%, max 10.2%
couponslatest -8.9%, min -8.9%, max 13.3%
wishlistlatest -8.9%, min -10.5%, max -1.9%
shippinglatest 0%, min -1.9%, max 11.5%
supportlatest -20.7%, min -20.7%, max -7.3%
notificationslatest 1.1%, min -1.7%, max 26%
Checkout grew while coupons fell below 0Advanced

Hover over the chart, or Tab in and use the arrow keys to move between items. The numbers are sample data.

Variants

Named looks for this chart. Each one is the example above with a few options or fields changed. The CLI (ztd-charts example horizon --variant <id>) and the MCP server know the same names.

One band

Year-over-year change in weekly requests by service (%)
Sample data

Three bands

Year-over-year change in weekly requests by service (%)
Sample data

Each row on its own scale

Year-over-year change in weekly requests by service (%)
Sample data

Code

HorizonChart.tsx
import { ChartCard, HorizonChart } from "ztd-charts";

const data = [
  {"week":"2026-05-04","service":"checkout","change":8},
  {"week":"2026-05-04","service":"search","change":10.9},
  {"week":"2026-05-04","service":"cart","change":5.5},
  {"week":"2026-05-04","service":"login","change":5},
  {"week":"2026-05-04","service":"signup","change":0.9},
  {"week":"2026-05-04","service":"orders","change":9.8},
  // … 306 more rows
];

export function Example() {
  return (
    <ChartCard number="47" title="Horizon chart" subtitle="Year-over-year change in weekly requests by service (%)" takeaway="Checkout grew while coupons fell below 0" level="advanced" replay>
      <HorizonChart
        data={data}
        x="week"
        y="change"
        series="service"
        unit="%"
      />
    </ChartCard>
  );
}

Props

<HorizonChart> takes these props. Rows marked Common work the same on every chart.

35 props

Prop
dataRequiredAn array of objects. Pass CSV, REST or database rows as they areobject[]
xRequiredx field (date, number or category)string | (d, i) => any
yRequiredy field. An array for wide tablesstring | (d, i) => number | string[]
seriesSeries field (long tables)string | (d, i) => string
bandsColor bands per row, 1 to 3. Default 1 when rowHeight is 24 or more, otherwise 2number
rowHeightRow height in px. Default 18 up to 24 series, otherwise 14. A set height stretches the rowsnumber
baselineWhere the bands start. Values below it mirror into the row in downColornumberDefault 0
downColorColor below the baseline (token name or CSS color)stringDefault "neutralStrong"
scale"shared": the same bands on every row, so rows compare. "free": each row fits its own values"shared" | "free"Default "shared"
showValuesValue column on the right: the last value, or the value at the pointed timebooleanDefault true
legendLegend on top with each band's rangebooleanDefault true
xTypeSets the x type yourself. Automatic when omitted: ISO dates, dotted dates such as "2025.03.01", Korean year-month-day dates, quarters such as "2024Q1" and English month names are read as dates. With "date", 10-digit numbers are Unix seconds"number" | "date" | "band"
dayFirstReads dates such as "05/03/2024", where either part could be the month, day first (5 March). Without it, a clear date in the column decides (25/03/2024), otherwise month first. true also reads "05.03.24" as day.month.yearboolean
aggregateHow rows with the same x (and series) combine: "sum" adds them, "mean" averages, "last" keeps the last row, "count" counts rows"sum" | "mean" | "last" | "count"Default "sum"
heightCommonHeight in px. Without it, each chart picks a default that fits its widthnumber
widthCommonFixed width in px. Without it, the chart fits its parentnumber
highlightCommonItem to highlight. An index, a name, an array, or "max" | "min" | "first" | "last" | "none"number | string | (number|string)[] | "max" …
formatCommonValue format. "number" | "integer" | "percent" (values are already percents: 42 → "42%") | "ratio" (0.42 → "42%") | "compact" | "currency" (KRW for Korean locales, otherwise USD; for another currency pass Intl options with currency) | "decimal" or Intl.NumberFormat options"number" | "percent" | "compact" | …
unitCommonUnit appended to values. For example "%" or "ms"string
localeCommonLocale for numbers, dates and the text a chart writes itself (tooltips, screen reader sentences). "ko" or "ko-*" switches to Korean. Falls back to the ThemeProvider localestringDefault "en-US"
animateCommonEntry and update animationbooleanDefault true
durationCommonAnimation length (ms)number
easingCommonMotion curve"spring" | "easeOut" | "easeInOut" | "linear"Default "spring"
staggerCommonDelay between items as they enter (ms)number
reducedMotionCommon"auto" follows the OS setting. true always turns motion offanyDefault "auto"
animateOnViewCommonPlay when the chart scrolls into viewbooleanDefault true
showLabelsCommonLabels drawn on the chart (values and names)booleanDefault true
tooltipCommonShow tooltips. { template: "{label} · {value} · owner {owner}" } writes them: {label}, {value}, {series} or any other column of the row. \n starts a new line, and a line with an empty value is left outtooltipDefault true
syncIdCommonCharts with the same syncId show the hovered x together (line, area, bar, candlestick, skyline). <ChartGrid sync> sets one for every chart inside itstring
ariaLabelCommonName for screen readersstring
descriptionCommonDescription for screen readers. Built from the data when omittedstring
onHoverCommonRuns when hover or keyboard focus moves to another item(e: ChartEvent | null) => void
onClickCommonRuns on click, Enter or Space(e: ChartEvent) => void
replayKeyCommonReplays the entry animation when it changesstring | number
themeCommonChanges theme tokens for this chart onlyPartial<ChartTheme>