Skip to main content

Timeline Chart

What is a timeline chart?​

A timeline chart (also called a timeline graph) shows events and periods in the order they happened, along a time axis. Points mark moments, such as an alarm or a product launch. Bars or bands mark spans of time, such as a machine running or a task in progress. Separate rows (lanes) let you compare several things over the same period.

A timeline chart of one eight-hour shift on a batch reactor line: lanes for batch phase, reactor state and feed pump state drawn as green running, amber idle, blue cleaning and red fault bands, and a bottom lane of red alarm triangles and white event dots, on a time axis from 06:00 to 14:00

An event timeline of one shift on a batch reactor line (sample data). Try the interactive version.

Key takeaways
  • A timeline chart puts when on the horizontal axis. Points are instants; bands are periods, and a band's width is its duration.
  • Lanes (rows) let you line up machines, people or processes, so you can see what was happening everywhere at one moment.
  • There are four main kinds: event timelines, state (swimlane) timelines, Gantt charts for project plans, and editor tracks in video and audio software.
  • In industry, colour carries meaning: green running, amber idle or waiting, red fault. Keep it consistent and give a key.
  • Short events vanish when you look at a whole day. A useful timeline lets you zoom from hours down to seconds.

Types of timeline chart​

Four sketches of timeline charts: an event timeline with dated milestones on one line; a state timeline with three lanes of green, amber, red and blue bands; a Gantt chart with staggered task bars, a dependency arrow and a dashed today line; and video editor tracks with clips on V1, V2, A1 and A2 under a red playhead

"Timeline" covers several charts that share a time axis but answer different questions:

TypeWhat it showsWhere you see it
Event timelineDated points on one line, each with a short labelHistories, incident reports, release notes, biographies
State timeline (swimlane, status history)One lane per machine or process, filled with bands for each state it was inIndustrial process control, equipment monitoring, network and server uptime
Gantt chartPlanned tasks as bars, with start and end dates, dependencies and progressProject management and scheduling
Editor tracksClips laid end to end on stacked tracks, read against a moving playheadVideo and audio editing software
Trace or log timelineNested spans showing how long each step of a request or job tookSoftware logging, monitoring and performance tracing

The first two record what happened. A Gantt chart plans what should happen. Editor tracks and trace timelines are the same picture used as a working tool: you read them, and in an editor you also drag clips around on them.

Joseph Priestley's Chart of Biography (1765) already laid out about two thousand lives across three thousand years on one time scale. A plant or a server farm today logs thousands of state changes a day, time-stamped to the second or better, so a timeline has to zoom.

How to read a timeline chart​

The parts of a timeline chart: lanes for Mixer M-1, Conveyor C-2 and Alarms; a time axis from 08:00 to 12:00; a green state band whose width is how long the state lasted; a short red fault that shows as a hairline; triangle markers for point events; and a colour key

  1. Check the time axis first. Note the start, the end and the unit: years, days, hours or seconds. Every lane shares this one scale.
  2. Read the lane labels. Each row is one thing: a machine, a process step, a person or a source of events.
  3. Read across one lane to follow its history. A band starts when the state changed and ends at the next change, so its width is its duration. Long, unbroken bands mean stable running; lots of thin bands mean frequent stops and starts.
  4. Read down the chart at one moment to see what everything was doing then. Lining up a fault in one lane with a change in another is often how a cause is found.
  5. Look for point events. Markers such as triangles or dots have no width: they are instants, such as an alarm, an operator action or a milestone.
  6. Use the colour key. Colours should mean the same thing in every lane, for example green for running and red for a fault.

Then zoom in on anything that looks crowded. At a whole-shift view, a fault lasting a few seconds is thinner than one pixel, and several alarms a few seconds apart draw as one marker.

Worked example: one shift on a batch reactor line​

Industrial plants record every state change and alarm with a time stamp in a database called a historian. A timeline chart turns those records into a picture that operators, process engineers and maintenance teams can read at a glance. The chart at the top of this page shows one eight-hour shift (06:00 to 14:00) on a batch reactor line, in four lanes:

  • Batch phase: the recipe step each batch is in (charge, heat, react, cool, discharge, clean). These are names, not good or bad states, so they share one colour and carry text labels.
  • Reactor R-101 and Feed pump P-201: what each piece of equipment was doing (running, idle, cleaning or fault).
  • Alarms and events: alarms as red triangles, and batch starts and operator actions as white dots.

At the full-shift view, something went wrong just before 12:00. The pump turns red, the reactor drops to idle and the batch shows a Hold. Zoomed in, the sequence is clear:

TimeLaneWhat happened
11:47:30Feed pump P-201Starts a dosing run
11:52:00Feed pump P-201First alarm: motor overload; the pump trips to Fault
11:52:04AlarmsLow feed flow (a consequence of the trip)
11:52:11AlarmsReactor level low (also a consequence)
11:52:14Reactor R-101 and batch phaseAn interlock holds the batch; the reactor goes idle
11:53:30AlarmsReactor temperature deviation
11:54:40Feed pump P-201Fault clears; the pump is idle, waiting for a reset
11:58:40Reactor R-101 and batch phaseOperator resets the pump and the batch resumes after a 6 min 26 s hold

The timeline shows three things a list of alarms alone would hide:

  • The first alarm points to the cause. Four alarms arrived within 90 seconds, but only the first, the pump overload, is the cause; the others followed from it. Recording the exact order of events like this is the job of a sequence of events recorder in power and process plants.
  • There was an earlier warning. The same pump tripped for 18 seconds at 07:31:12 and reset itself. At the full-shift view it is a hairline; zoom in on 07:31 in the live chart to find it.
  • The totals tell a different story from the picture. Over the shift the reactor ran for 7 h 9 min (89% of the time), was cleaned for 30 min and idle for 21 min. The pump was in fault for under 3 minutes in total (0.6%), yet that was enough to hold a batch.

How to describe a timeline chart​

Use this template when you report what a timeline shows:

[Lane] was [state] for [duration], from [start] to [end]. It began with [first event] at [time], and [what else changed at the same time].

For example: "Batch B-1043 was held for 6 min 26 s, from 11:52:14 to 11:58:40. It began with a motor overload trip on feed pump P-201 at 11:52:00, and the reactor went idle while three further alarms followed within 90 seconds."

Timeline chart vs Gantt chart​

A Gantt chart is a timeline chart made for planning projects. Its bars are tasks with planned dates, and it usually adds dependencies (this task can't start until that one ends), percent complete and a "today" line. It is named after Henry Gantt, who designed it in the 1910s.

Most other timelines show what actually happened: when each event occurred and how long each state lasted, often measured to the second and recorded automatically. If your bars are a plan, use a Gantt chart. If they are a record of states or events, use an event or state timeline.

When to use a timeline chart​

Use a timeline chart when the question is when and for how long, and when things happening at the same time matter. Typical uses:

  • industrial process control: equipment states, batch phases, alarms and operator actions over a shift;
  • monitoring and logging: service uptime, job runs and errors, or each step of a slow request;
  • media editing: clips, effects and audio laid out against a playhead;
  • histories and reports: the key dates in a project, an incident or a company's past.
ChartBest for
Timeline chartWhen events happened, how long states lasted, and what overlapped
Line chartA measured value that changes continuously over time, such as a temperature or a price
Gantt chartA project plan: tasks, planned dates and dependencies
HeatmapA value for every time slot across many rows, such as load per hour per machine

In process monitoring the two are often stacked: line charts for the measured values (temperature, flow, pressure) above a state timeline for the equipment states and alarms, sharing one time axis so they zoom together.

Common timeline chart mistakes​

  • Short events disappear at the full view. A 20-second fault is thinner than a pixel on an eight-hour chart. Let readers zoom, give every band a minimum visible width, or add a point marker for each fault or alarm.
  • Colours that mean different things in different lanes. If red is a fault in one lane, don't use it for a normal state in another. Save the strongest colours for abnormal states, and give a key.
  • Relying on colour alone. Red and green are hard to tell apart for many people with colour vision deficiency. Add labels, tooltips, or a different marker shape for alarms.
  • Colour-coding labels that aren't states. Batch phases or task names aren't good or bad, so giving each its own bright colour suggests a meaning that isn't there. Use one neutral colour and write the names on the bands.
  • Mixed or missing time zones. Plant historians, servers and people often log in different time zones. Store times in UTC and say which zone the axis shows.
  • Overlapping events in one lane. If two states can be true at once, they belong in separate lanes; otherwise one band hides the other.
  • Using a timeline for a measured value. A temperature or a price is a line chart. Turn it into bands only for thresholds, such as "above limit".

How to create a timeline chart in JavaScript, React or Angular​

SciChart.js draws timelines with rectangle series for the bands and scatter series for the point events. It renders with WebGL and WebGPU, so a timeline with a long history stays smooth to zoom and pan, from a whole shift down to single seconds. Try the chart below: scroll to zoom in time, drag to pan, double-click to see the whole shift again, and hover over a band or a marker to see its times. Zoom in around 11:52 to see the alarms separate, and around 07:31 to find the short fault.

Here is the code for this chart:

// Create a JavaScript timeline chart with SciChart.js: state bands in lanes, plus point events, on a time axis
const {
SciChartSurface,
NumericAxis,
DateTimeNumericAxis,
FastRectangleRenderableSeries,
XyxyDataSeries,
XyScatterRenderableSeries,
XyDataSeries,
TrianglePointMarker,
EllipsePointMarker,
TextLabelProvider,
EAxisAlignment,
EColumnMode,
EColumnYMode,
EAutoRange,
EXyDirection,
ENumericFormat,
NumberRange,
SciChartJsNavyTheme,
CursorModifier,
MouseWheelZoomModifier,
ZoomPanModifier,
ZoomExtentsModifier,
LegendModifier,
ELegendOrientation,
ELegendPlacement
} = SciChart;
// or, for npm, import { SciChartSurface, ... } from "scichart"

const { wasmContext, sciChartSurface } = await SciChartSurface.create(divElementId, {
theme: new SciChartJsNavyTheme()
});

const { date, shiftStart, shiftEnd, lanes, alarms, events } = getShiftData();

// Times become seconds since 1970 (UTC), the unit DateTimeNumericAxis expects
const toSeconds = (time) => Date.parse(`${date}T${time}Z`) / 1000;
const formatTime = (seconds) => new Date(seconds * 1000).toISOString().substring(11, 19);
const formatDuration = (seconds) => {
const h = Math.floor(seconds / 3600);
const m = Math.floor((seconds % 3600) / 60);
const s = Math.round(seconds % 60);
return [h ? `${h} h` : "", m ? `${m} min` : "", s ? `${s} s` : ""].filter(Boolean).join(" ");
};

// Lanes run top to bottom: the first lane gets the highest y value. Point events go in the bottom lane (y = 0).
const laneNames = ["Alarms and events", ...lanes.map((lane) => lane.name).reverse()];
const laneY = (laneIndex) => lanes.length - laneIndex;
const halfLaneHeight = 0.32;

// State colours carry meaning: green is normal, amber is waiting, red is a fault, blue is cleaning.
// Batch phases are names, not good or bad, so they share one neutral colour and are labelled instead.
const stateColours = {
Running: "#3FB47F",
Idle: "#F4B740",
Fault: "#E5484D",
Cleaning: "#4C8DF6",
Phase: "#7E72C9"
};

// 1. Turn each lane's list of state changes into bands: each band runs from one change to the next
const bandsByState = {};
lanes.forEach((lane, laneIndex) => {
lane.changes.forEach(([time, state], i) => {
if (!state) return;
const start = toSeconds(time);
const end = toSeconds(i + 1 < lane.changes.length ? lane.changes[i + 1][0] : shiftEnd);
const colourKey = laneIndex === 0 ? "Phase" : state;
(bandsByState[colourKey] = bandsByState[colourKey] || []).push({
lane: lane.name,
state,
start,
end,
y: laneY(laneIndex)
});
});
});

// X axis: date and time. Labels switch from hours to minutes to seconds as you zoom in
const xAxis = new DateTimeNumericAxis(wasmContext, {
visibleRange: new NumberRange(toSeconds(shiftStart), toSeconds(shiftEnd)),
drawMinorGridLines: false
});
xAxis.labelProvider.cursorNumericFormat = ENumericFormat.Date_HHMMSS; // the cursor's time label, to the second
sciChartSurface.xAxes.add(xAxis);

// Y axis: one lane per row, labelled with the lane name. Fixed, so zooming only stretches time
sciChartSurface.yAxes.add(
new NumericAxis(wasmContext, {
axisAlignment: EAxisAlignment.Left,
labelProvider: new TextLabelProvider({ labels: laneNames, useNativeText: false }),
autoRange: EAutoRange.Never,
visibleRange: new NumberRange(-0.6, lanes.length + 0.75),
autoTicks: false,
majorDelta: 1,
minorDelta: 1,
drawMajorGridLines: false,
drawMinorGridLines: false,
drawMajorBands: false,
labelStyle: { fontSize: 14 }
})
);

// 2. One rectangle series per state, so each state has one colour and one legend entry
Object.keys(bandsByState).forEach((colourKey) => {
const bands = bandsByState[colourKey];
sciChartSurface.renderableSeries.add(
new FastRectangleRenderableSeries(wasmContext, {
dataSeries: new XyxyDataSeries(wasmContext, {
xValues: bands.map((b) => b.start),
x1Values: bands.map((b) => b.end),
yValues: bands.map((b) => b.y + halfLaneHeight),
y1Values: bands.map((b) => b.y - halfLaneHeight),
metadata: bands.map((b) => ({
isSelected: false,
label: b.state,
tooltip: [
`${b.lane}: ${b.state}`,
`${formatTime(b.start)} to ${formatTime(b.end)} (${formatDuration(b.end - b.start)})`
]
})),
dataSeriesName: colourKey === "Phase" ? "Batch phase" : colourKey
}),
columnXMode: EColumnMode.StartEnd, // x = start time, x1 = end time
columnYMode: EColumnYMode.TopBottom, // y = top of the band, y1 = bottom
fill: stateColours[colourKey],
// The outline also colours the legend entry. Phase bands sit side by side, so theirs is lighter to keep them apart
stroke: colourKey === "Phase" ? "#C9C2F2" : stateColours[colourKey],
strokeThickness: 1,
// Phase names are written inside their bands
dataLabels:
colourKey === "Phase"
? {
color: "#FFFFFF",
style: { fontSize: 13, fontFamily: "Arial" },
metaDataSelector: (metadata) => metadata["label"]
}
: undefined
})
);
});

// 3. Point events: alarms as red triangles, other events as white dots, in the bottom lane
const addPointEvents = (items, name, colour, pointMarker, yOffset) => {
sciChartSurface.renderableSeries.add(
new XyScatterRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext, {
xValues: items.map(([time]) => toSeconds(time)),
yValues: items.map(() => yOffset),
metadata: items.map(([time, text]) => ({
isSelected: false,
tooltip: [`${name}: ${text}`, `at ${time}`]
})),
dataSeriesName: name
}),
stroke: colour, // the legend entry's colour
pointMarker
})
);
};
addPointEvents(
alarms,
"Alarm",
"#E5484D",
new TrianglePointMarker(wasmContext, { width: 14, height: 14, fill: "#E5484D", stroke: "#FFFFFF", strokeThickness: 1 }),
0.15
);
addPointEvents(
events,
"Event",
"#FFFFFF",
new EllipsePointMarker(wasmContext, { width: 11, height: 11, fill: "#FFFFFF", stroke: "#1C2A4A", strokeThickness: 1 }),
-0.15
);

// Tooltip: show only what is under the mouse. The list can be empty, so always return an array
const tooltipDataTemplate = (seriesInfos) => {
const lines = [];
(seriesInfos || []).forEach((info) => {
if (info && info.isHit && info.pointMetadata && info.pointMetadata.tooltip) {
lines.push(...info.pointMetadata.tooltip);
}
});
return lines;
};

// Zoom and pan in time only (lanes stay put); double-click to see the whole shift again
sciChartSurface.chartModifiers.add(
new CursorModifier({ showTooltip: true, showYLine: false, tooltipDataTemplate, hitTestRadius: 8 }),
new MouseWheelZoomModifier({ xyDirection: EXyDirection.XDirection }),
new ZoomPanModifier({ xyDirection: EXyDirection.XDirection }),
new ZoomExtentsModifier({ xyDirection: EXyDirection.XDirection }),
new LegendModifier({
placement: ELegendPlacement.TopRight,
orientation: ELegendOrientation.Horizontal,
showCheckboxes: false
})
);

Key points:

  • Historians and logs usually store state changes, not bands. Turn each change into a band that runs until the next change (step 1 in the code), with times in seconds since 1970 (UTC), which is what the DateTimeNumericAxis expects. Its labels switch from hours to minutes to seconds as you zoom.
  • A FastRectangleRenderableSeries with an XyxyDataSeries draws each band from x to x1 (start and end time) and from y to y1 (top and bottom of its lane), set by columnXMode: EColumnMode.StartEnd and columnYMode: EColumnYMode.TopBottom. One series per state gives each state one colour and one legend entry.
  • The lanes are rows on a NumericAxis with a TextLabelProvider for the lane names, fixed with autoRange: EAutoRange.Never. Setting xyDirection: EXyDirection.XDirection on the zoom modifiers makes zooming stretch time only.
  • Point events are an XyScatterRenderableSeries with a triangle or dot marker. For a handful of events, or ones users should drag, annotations such as vertical lines also work. Put the text for each tooltip in the data series' metadata.

See it in the demo app: JavaScript Gantt chart · React Gantt chart · Angular Gantt chart

Go deeper: SciChart.js timeline chart documentation (the rectangle series), the SciChart.js date-time axis documentation, and the SciChart.js annotations documentation for markers and labels on a timeline.

Frequently asked questions​

What is a timeline chart used for?​

A timeline chart is used to show when things happened, how long they lasted and what happened at the same time. Typical uses are company or project histories, the running, idle and fault states of machines on a production line, alarms and operator actions in a control room, clips on the tracks of a video editor, and requests or jobs in software logs.

What is the best chart for a timeline?​

It depends on what you are showing. For a handful of dated milestones, use an event timeline: one line with labelled points. For the states of several machines or processes over time, use a state (swimlane) timeline with one lane of coloured bands each. For planned tasks with dependencies, use a Gantt chart. For a value that changes continuously, such as a temperature, use a line chart instead.

What is the difference between a Gantt chart and a timeline chart?​

A Gantt chart is one kind of timeline chart, made for planning. It shows tasks as bars with planned start and end dates, often with dependencies between tasks, progress and a today line. Other timeline charts record what actually happened: dated events on a line, or the states of machines and processes in lanes, often measured down to the second.

What is a timeline chart called?​

A timeline chart is also called a timeline graph, a chronology or a time line. Variants have their own names: an event timeline or milestone chart for dated points, a state timeline, swimlane timeline or status history for lanes of state bands, a Gantt chart for project schedules, and a sequence of events chart in power and process plants.

How do I make a timeline chart in JavaScript?​

With SciChart.js, turn each lane's state changes into bands with a start time and an end time. Draw them with a FastRectangleRenderableSeries and an XyxyDataSeries, using EColumnMode.StartEnd and EColumnYMode.TopBottom, on a DateTimeNumericAxis. Give each lane its own row on a numeric y-axis with a TextLabelProvider, and draw point events such as alarms with an XyScatterRenderableSeries. The same chart works in React with scichart-react and in Angular with scichart-angular.

Sources​

  • Wikipedia, A Chart of Biography. Joseph Priestley's 1765 chart of about two thousand lives from 1200 BC to 1800 AD, an early timeline chart.
  • Wikipedia, Gantt chart. Henry Gantt's design of around 1910 to 1915, and Karol Adamiecki's earlier harmonogram.
  • Wikipedia, Sequence of events recorder. Devices that time-stamp each change of state so the order of events can be rebuilt for root-cause analysis.
  • ISA, ISA-101 series of standards. The standard for designing human-machine interfaces (HMIs) in process automation, where state and alarm timelines are used.