Trend · Intermediate
Timeline
When things started and ended, and what overlapped: one bar per item on a time axis.
- Use when
- Items with a start and an end, such as a project schedule, deployment and job runs, an agent run log or an incident timeline
- Avoid when
- Each item has one value and no start or end (use bar), or the dependencies between tasks are the story
Try it
41
Timeline
One agent run from plan to merge, in minutes
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 timeline --variant <id>) and the MCP server know the same names.
Status strip
One agent run from plan to merge, in minutes
Clock times
One agent run from plan to merge, in minutes
Longest first
One agent run from plan to merge, in minutes
Now line
One agent run from plan to merge, in minutes
Drag to zoom
One agent run from plan to merge, in minutes
Code
Timeline.tsx
import { ChartCard, Timeline } from "ztd-charts";
const data = [
{"step":"Plan","start":0,"end":3,"run":"Agent run","state":"Working","startAt":"2026-11-10T09:00","endAt":"2026-11-10T09:03"},
{"step":"Search code","start":3,"end":8,"run":"Agent run","state":"Working","startAt":"2026-11-10T09:03","endAt":"2026-11-10T09:08"},
{"step":"Edit files","start":8,"end":15,"run":"Agent run","state":"Working","startAt":"2026-11-10T09:08","endAt":"2026-11-10T09:15"},
{"step":"Run tests","start":15,"end":18,"run":"Agent run","state":"Working","startAt":"2026-11-10T09:15","endAt":"2026-11-10T09:18"},
{"step":"Fix failing test","start":18,"end":22,"run":"Agent run","state":"Fixing","startAt":"2026-11-10T09:18","endAt":"2026-11-10T09:22"},
{"step":"Run tests","start":22,"end":24,"run":"Agent run","state":"Working","startAt":"2026-11-10T09:22","endAt":"2026-11-10T09:24"},
// … 3 more rows
];
export function Example() {
return (
<ChartCard number="41" title="Timeline" subtitle="One agent run from plan to merge, in minutes" takeaway="18 of 43 minutes went to waiting for CI" level="intermediate" replay>
<Timeline
data={data}
label="step"
start="start"
end="end"
unit=" min"
/>
</ChartCard>
);
}
Props
<Timeline> takes these props. Rows marked Common work the same on every chart.
34 props
| Prop |
|---|
dataRequiredAn array of objects. Pass CSV, REST or database rows as they areobject[] |
labelRequiredRow name. Items with the same name share a rowstring | (d, i) => string |
startRequiredStart: a number (minutes, seconds, any unit) or a date or date-timestring | (d, i) => any |
endRequiredEnd, same kind as start. Equal to start draws a point event; empty means still openstring | (d, i) => any |
groupGroup field (one color per group, and the legend)string | (d, i) => string |
statusState of the item, written inside the bar and in the tooltip. Without group it also colors the bars and makes the legend, so a row of consecutive states reads as a status stripstring | (d, i) => string |
xTypeTime axis type. Automatic when omitted: dates and date-times (ISO, "2025.03.01", Korean dates, quarters, English month names) make a date axis, otherwise numbers in options.unit. With "date", numbers are timestamps (10 digits are Unix seconds) or years"number" | "date" |
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 |
sortRow order: "none" keeps the data order, "start" puts the earliest start first, "duration" the longest total first"none" | "start" | "duration"Default "none" |
referenceLinesVertical lines on the time axis [{ x, label }]. x is a number or a date, like the data. Lines outside the axis range are not drawnany[] |
nowTime of a "Now" line, in the same form as the data. Items without an end run up to it. The chart never reads the clock, so server and browser draw the sameany |
brushDrag across the time axis to zoom in: "zoom" or true (keyboard: Shift+arrows, Enter). Escape or "Show all" zooms outanyDefault false |
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). <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> |
Also in Trend
- Line chartChange over time
- Area chartRunning totals and a changing mix (stacked, 100% stacked)
- StreamgraphMany series as flowing bands that show size and change
- SparklineA small trend line next to a table cell or KPI
- Calendar heatmapDaily amounts on a weekly grid
- Bump chartRank changes over time
- Candlestick chartOpen, high, low and close for each period in one candle
- SkylineStacked volume per period as blocks, with a smaller outcome in the same unit standing in front