Real-Time Dashboard
What is a real-time dashboard?
A real-time dashboard (also called a live dashboard or monitoring dashboard) is a screen of charts, gauges and numbers that updates by itself as new data arrives, usually within a second or a few seconds of each event. People use it to watch a process, machine, system or market while it is happening, and to act before a problem grows.

A simulated production-line dashboard with six panels fed from one data stream. Try the interactive version, change the update and data rates and watch the frame time.
- A real-time dashboard is pushed new data continuously; a BI dashboard is refreshed on a schedule.
- Data rate, update rate and frame rate are three different numbers, and each adds its own share of latency.
- Strip charts, gauges, sparklines, current-value bars and heatmaps each suit a different kind of live data.
- Lay it out overview first, keep time axes synchronised, and always show when the data was last updated.
- Many live charts on one page stay fast when they share one GPU context (a WebGL context or WebGPU device), append to circular buffers and are updated in batches.
Real-time dashboards vs BI dashboards
The word "dashboard" covers two quite different tools. A business intelligence (BI) dashboard reads a data warehouse that is loaded on a schedule, so its numbers are as fresh as the last load, often an hour or a day old. A real-time dashboard is fed from live sources and changes on screen without anyone pressing refresh.
| Real-time dashboard | BI dashboard | |
|---|---|---|
| Data from | Sensors, devices, application events, market feeds, streamed as they happen | A data warehouse or database, loaded in batches |
| Freshness | Sub-second to a few seconds | Minutes to a day |
| Question it answers | What is happening now, and is anything wrong? | How did we do, and what is the trend? |
| Time window | The last seconds, minutes or hours, scrolling | Days, months, years, fixed |
| Typical charts | Strip charts, gauges, sparklines, alarm lists, live heatmaps | Bar and line charts, tables, filters, drill-downs |
| Used by | Operators, engineers, clinicians, traders, on-call staff | Managers and analysts |
A "real-time analytics dashboard" sits between the two: it computes running totals and rates from live events, such as orders per minute or active users, and shows them within seconds. The design advice on this page applies to all live dashboards, from a factory floor to a web shop.
How does a real-time dashboard work?
Every live dashboard follows a similar path from the thing being measured to the pixels on the screen. The path also explains where delay comes from.
- Sources produce readings: sensors and PLCs (programmable logic controllers) on a machine, devices in the field, servers and applications writing metrics and logs, or a market data feed.
- Ingest collects them. Devices often publish to an MQTT broker, a lightweight publish-and-subscribe server designed for small devices and unreliable networks. Applications usually write to a message queue or event stream.
- A server processes the stream: it cleans and converts values, computes rates and averages, checks alarm limits and stores everything in a time-series database or historian for later.
- The server pushes new values to every open dashboard. A WebSocket keeps one two-way connection open between browser and server; server-sent events are a simpler one-way stream from server to browser over plain HTTP. Polling, where the page asks for new data every few seconds, is simpler again but adds up to one polling interval of delay.
- The browser buffers what arrives. Readings are kept in typed arrays (compact blocks of numbers, rather than one object per reading) and in circular buffers that keep the last few minutes and drop the oldest values.
- The dashboard draws. On a timer, it appends everything buffered since the last update to its charts and scrolls their time axes.
Latency, data rate, update rate and frame rate
Four numbers describe how "live" a dashboard is, and they are easy to mix up:
| Term | What it measures | Example |
|---|---|---|
| Data rate (sample rate) | How many readings each channel produces per second | A vibration sensor sampled 1,000 times a second |
| Update rate | How often the dashboard adds new data to its charts | 10 times a second (10 Hz) |
| Frame rate | How often the screen can show a new picture | 60 frames a second on most monitors; 120 or more on many phones and gaming screens |
| Latency | The delay from an event to seeing it on screen | 150 ms from a pressure spike to the trace moving |
Take that vibration sensor at 1,000 readings a second and a dashboard updating at 10 Hz. Each update appends about 100 points per channel, and a reading waits up to 100 ms in the buffer before it is drawn. Add the network, any server processing and up to one screen frame (about 17 ms at 60 Hz), and the total latency is a little over a tenth of a second. At a 1 Hz update rate the same reading can wait a full second.
Two limits follow from this. An update rate above the screen's frame rate draws pictures nobody sees, so the display's refresh rate is the sensible ceiling for a moving trace. And a number on screen that changes many times a second can't be read, so readouts and gauges are often updated more slowly than the traces beside them. Try both in the live example: at 1 Hz the traces jump once a second; at 60 Hz they glide.
Which charts work best for live data?
Not every chart survives being updated many times a second. Charts that work live keep a fixed frame (fixed axes, fixed positions) so only the data moves.
| Chart | Shows | How it behaves live | Use it for |
|---|---|---|---|
| Strip chart | One or more values over a scrolling time window | New data enters at the right, the oldest leaves at the left | Signals where the shape over time matters: current, vibration, ECG, prices |
| Gauge | One value against its range and limits | The needle or arc moves; the scale stays still | The one or two numbers people check first, with normal and alarm bands |
| Big-number tile | One value as large digits, often with a change arrow | The digits change | Counts and rates such as orders per minute, active alarms |
| Sparkline | The recent trend of one value, without axes | A small strip chart | Many values side by side: one per device, server or KPI |
| Bar chart of current values | The latest value of several items, compared | Bars grow and shrink in place | Output per machine, load per server, queue length per region |
| Heatmap | Many channels over time as colour | Columns scroll in from the right | Dozens of similar sensors at once, temperature zones, spectrograms |
| Alarm list | Active and recent alarms, newest first | Rows appear and are acknowledged | Anything that needs a response |
Pie charts and charts that re-sort or rescale on every update work badly live: slices and bars that keep swapping places can't be followed.
How to create a real-time dashboard
Start from the decisions the dashboard supports, then choose the signals, charts, update rates and layout that serve them. These steps work whatever you build it with:
- Write down the decisions the dashboard supports ("stop the line if vibration exceeds 7 mm/s", "page the on-call engineer if errors pass 1%"). Each panel should help with one of them.
- List the signals behind those decisions, with each one's data rate, units and normal range.
- Choose the transport: MQTT or a cloud IoT service for devices, a WebSocket or server-sent events to the browser, polling only for data that changes every few seconds or less.
- Choose an update rate per panel. Moving traces can follow the screen; readouts, bars and business numbers can update once a second or slower.
- Pick a chart per signal from the table above, and fix each axis to the signal's normal range plus its alarm limits.
- Lay out the screen (below), with alarms and the "last updated" time in fixed places.
- Test with the full data rate, the largest number of panels and a slow laptop, not just your development machine.
Layout: overview first, detail on demand
Ben Shneiderman's rule for visual information seeking, "overview first, zoom and filter, then details on demand", fits live dashboards well:
- Overview: put the few numbers that decide action in the top row, as gauges or big numbers with their limits.
- Trends: strip charts and sparklines below them show how each number got there.
- Detail: clicking a panel, pausing, zooming or hovering for a tooltip gives the exact values; it shouldn't need a different screen.
- Alarms: keep the alarm list and any alarm banner in one fixed place, so people know where to look. Keep normal values in calm colours and save red and amber for abnormal states, as the ISA-101 standard for operator screens recommends (see our HMI and SCADA guide).
Synchronised time axes
When a dashboard has several strip charts, they should share one time window and one "now", so a spike at 14:03:07 in one chart sits directly above the change it caused in another. That needs three things: the same visible time range on every chart, the same width for every chart's value axis (so the plot areas line up), and a cursor that shows every chart's value at the hovered time. Zooming or panning one chart should move the others.
Many charts on one page: performance
A busy dashboard can have dozens of charts redrawing many times a second. The techniques that cut its drawing work are the same whatever the domain:
- Share one drawing context. Browsers allow only a few WebGL contexts per page (often 16 in Chrome and Safari, and 8 in Chrome on Android, according to our performance tips). The limit doesn't apply to WebGPU, which SciChart.js uses by default. A library that draws every chart through one shared context can put far more charts on a page.
- Append, don't rebuild. Adding the new points to an existing series costs a fraction of re-creating the series or the chart on every update.
- Batch the updates. Buffer readings as they arrive and add them in one call per update, not one call per reading.
- Use circular buffers. A fixed-size first-in, first-out buffer keeps the last N points, so memory stays flat however long the dashboard runs.
- Use typed arrays.
Float64Arraystores numbers compactly and copies quickly into the chart. - Reduce what is drawn. When a window holds more points than the chart has pixels across, draw a reduced set that keeps every peak (min-max decimation). Our downsampling guide explains why a plain average hides spikes, and the big data visualisation guide covers millions of points.
- Stop drawing what can't be seen. Browsers pause
requestAnimationFramein background tabs, and charts scrolled out of view can stop drawing too. - Keep small panels simple: fewer gridlines and labels on a sparkline or a small tile cost less to draw and read better.
Real-time dashboard examples
Real-time dashboards appear wherever a delay of seconds matters, from factory floors and race cars to trading desks, patient monitors and server rooms.
| Domain | What's on the dashboard | How fast the data is | Read more |
|---|---|---|---|
| IoT and sensor monitoring | Device status, sparklines of each sensor, temperature or energy heatmaps, battery and signal gauges | Usually every few seconds to minutes per device, but thousands of devices | Telemetry guide |
| Manufacturing | Line speed, output against target, rejects, motor current and vibration, oven temperatures | Hundreds to thousands of samples a second for vibration; seconds for counts | HMI and SCADA guide, SciChart for HMI and SCADA |
| Motorsport | Speed, throttle, brake, gear, tyre and brake temperatures, lap times and the gap to a reference lap | Many samples a second per channel while the car is running | Motorsport telemetry guide |
| Trading | Price ticks, candlesticks, order book depth, positions and P&L | Many updates a second at busy times | Candlestick chart guide |
| Remote patient monitoring | Heart rate, SpO₂, blood pressure and ECG, with alerts for out-of-range values | ECG at hundreds of samples a second; vital-sign summaries every few seconds to minutes | Strip chart guide, SciChart for medical charts, SciChart for telehealth |
| Server and network monitoring | Requests per second, latency percentiles, error rate, CPU and memory per host | Typically every 10 to 60 seconds per metric, across many hosts | Heatmap guide |
| Test and measurement | Many channels from a test rig, limits, pass/fail | Thousands to millions of samples a second per channel at the instrument, reduced before display | SciChart for instrumentation |
Common real-time dashboard mistakes
Most real-time dashboard mistakes either show more change than anyone can follow or hide the fact that the data has stopped.
- Updating faster than anyone can read. Thirty panels all flickering at 60 Hz tire the eye and hide the one change that matters. Update numbers slowly, let traces follow the screen, and leave static panels static.
- No "last updated" indicator. If the connection drops, a frozen dashboard looks exactly like a calm one. Show the time of the newest data, and grey out or flag panels whose data is stale.
- Unsynchronised time axes. Two charts showing slightly different windows make cause and effect look out of order. Share one window and line up the plot areas.
- Colour overload. When every series, tile and background is brightly coloured, an alarm colour no longer stands out. Use a calm palette and keep strong colours for exceptions.
- Autoscaling live axes. An axis that rescales with every update makes a tiny wobble look dramatic and the trace jump about. Fix the range to the normal values plus the limits.
- Too many charts on one screen. If a panel doesn't support a decision, it costs attention and drawing time. Move it to a detail page.
- No way to stop and look. People need to pause a scrolling chart, zoom into the last minute and read exact values, then return to live.
How to build a real-time dashboard in JavaScript, React or Angular
The demo simulates a production line on up to six panels that all draw with one shared rendering engine. At the highest data rate its strip charts hold up to 1.2 million points, and the readout shows the frame time your device takes to draw them. In the simulation, three motor currents and a pump vibration sensor stream in at the data rate you choose, and line speed, station output, utilities and eight oven zones arrive four times a second.
Use Update rate to redraw the dashboard 1, 10 or 60 times a second, and Data rate to change how many readings each fast channel sends per second (100 to 10,000, so up to 1.2 million points on the strip charts). Panels shows 2, 4 or 6 panels. Pause stops the display while data keeps arriving; the readout then shows how far behind live it is. The readout also shows the points drawn and the number of charts. Hover a strip chart to read both at once; scrolling or dragging on one pauses the dashboard and zooms or pans both, and double-clicking shows the whole window.
Here is the code for this dashboard. The plant simulation and the controls are plain JavaScript; SciChart.js draws every panel and keeps the strip charts in step. The React and Angular versions show the core of it: two synchronised strip charts fed from a buffer at a fixed update rate.
- JavaScript
- React
- Angular
// A real-time dashboard with SciChart.js: two strip charts with synchronised time axes, a gauge,
// a live bar chart, a row of sparklines and a scrolling heatmap, all fed from one data stream
const {
SciChartSurface,
SciChartPolarSurface,
SciChartVerticalGroup,
NumericAxis,
PolarNumericAxis,
NumberRange,
EAutoRange,
EAxisAlignment,
EPolarAxisMode,
EXyDirection,
ETextAlignment,
EHorizontalAnchorPoint,
EVerticalAnchorPoint,
ECoordinateMode,
EColumnDataLabelPosition,
FastLineRenderableSeries,
FastColumnRenderableSeries,
UniformHeatmapRenderableSeries,
XyDataSeries,
UniformHeatmapDataSeries,
HeatmapColorMap,
PolarArcAnnotation,
NativeTextAnnotation,
HorizontalLineAnnotation,
SciChartJsNavyTheme,
CursorModifier,
MouseWheelZoomModifier,
ZoomPanModifier,
ZoomExtentsModifier,
LegendModifier,
ELegendOrientation,
ELegendPlacement
} = SciChart;
// or, for npm, import { SciChartSurface, ... } from "scichart"
const WINDOW = 30; // seconds of history on the strip charts, sparklines and heatmap
const SLOW_POINTS = WINDOW / plant.SLOW_STEP; // slow values kept: 120
const startClock = Date.now() / 1000 - WINDOW; // time 0 on the x-axis, as a clock time
const clock = (t) => new Date((startClock + t) * 1000).toLocaleTimeString("en-GB");
// Each chart gets a small title; freezeWhenOutOfView stops drawing charts scrolled off screen
const surfaceOptions = (title) => ({
theme: new SciChartJsNavyTheme(),
title,
titleStyle: { fontSize: 14, color: "#E8EDF5", alignment: ETextAlignment.Left, placeWithinChart: false },
freezeWhenOutOfView: true
});
// ---- Strip charts: fast channels, one shared time window ----
const stripSpecs = [
{ div: ui.cells.strip1, title: "Motor current (A)", range: new NumberRange(0, 40), tickStep: 10, legend: true,
channels: [{ name: "Motor 1", colour: "#50C7E0" }, { name: "Motor 2", colour: "#F6E05E" }, { name: "Motor 3", colour: "#C3B4F0" }] },
{ div: ui.cells.strip2, title: "Vibration (mm/s)", range: new NumberRange(-12, 12), tickStep: 6,
channels: [{ name: "Pump vibration", colour: "#3BD16F" }] }
];
const group = new SciChartVerticalGroup(); // lines up the y-axes, so the two time axes match exactly
const strips = [];
for (const spec of stripSpecs) {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(spec.div, surfaceOptions(spec.title));
const xAxis = new NumericAxis(wasmContext, { autoRange: EAutoRange.Never, maxAutoTicks: 6, drawMinorGridLines: false });
xAxis.labelProvider.formatLabel = (t) => clock(t); // show clock time
xAxis.labelProvider.formatCursorLabel = (t) => clock(t);
sciChartSurface.xAxes.add(xAxis);
// A fixed y-range: an axis that rescales on every update makes the lines jump about
sciChartSurface.yAxes.add(
new NumericAxis(wasmContext, { autoRange: EAutoRange.Never, visibleRange: spec.range, autoTicks: false, majorDelta: spec.tickStep, minorDelta: spec.tickStep / 2, labelPrecision: 0, drawMinorGridLines: false })
);
const lines = spec.channels.map((channel) => {
const line = new FastLineRenderableSeries(wasmContext, { stroke: channel.colour, strokeThickness: 1.5 });
sciChartSurface.renderableSeries.add(line);
return line;
});
// Hover on either chart: the cursor and tooltip follow on both (modifierGroup)
sciChartSurface.chartModifiers.add(
new CursorModifier({ modifierGroup: "strips", showTooltip: true, showYLine: false }),
new MouseWheelZoomModifier({ xyDirection: EXyDirection.XDirection }),
new ZoomPanModifier({ xyDirection: EXyDirection.XDirection }),
new ZoomExtentsModifier({ xyDirection: EXyDirection.XDirection })
);
group.addSurfaceToGroup(sciChartSurface);
strips.push({ sciChartSurface, wasmContext, xAxis, lines, channels: spec.channels, legend: spec.legend, dataSeries: [] });
}
const wasmContext = strips[0].wasmContext;
// Zooming or panning one strip chart moves the other
for (const strip of strips) {
strip.xAxis.visibleRangeChanged.subscribe(({ visibleRange }) => {
for (const other of strips) {
if (other !== strip && !other.xAxis.visibleRange.equals(visibleRange)) other.xAxis.visibleRange = visibleRange;
}
});
}
// fifoCapacity makes each series a circular buffer: it keeps the newest points and drops the oldest,
// so memory stays flat however long the dashboard runs. Changing the data rate changes the capacity.
let dataRate = Number(ui.dataSelect.value); // points per second, per channel
let now = WINDOW; // seconds since time 0, of the newest data received
function createFastSeries() {
const capacity = dataRate * WINDOW;
const count = capacity;
const xValues = new Float64Array(count);
const yValues = [0, 1, 2, 3].map(() => new Float64Array(count));
for (let i = 0; i < count; i++) {
const t = now - WINDOW + (i + 1) / dataRate;
xValues[i] = t;
plant.fast(t).forEach((v, c) => (yValues[c][i] = v));
}
let channel = 0;
for (const strip of strips) {
const old = strip.dataSeries;
strip.dataSeries = strip.lines.map((line, i) => {
const series = new XyDataSeries(wasmContext, {
dataSeriesName: strip.channels[i].name,
fifoCapacity: capacity,
isSorted: true,
containsNaN: false
});
series.appendRange(xValues, yValues[channel++]);
line.dataSeries = series;
return series;
});
old.forEach((series) => series.delete());
}
}
createFastSeries();
// A legend names the lines, so colour isn't the only clue
for (const strip of strips.filter((s) => s.legend)) {
strip.sciChartSurface.chartModifiers.add(
new LegendModifier({ showCheckboxes: false, orientation: ELegendOrientation.Horizontal, placement: ELegendPlacement.TopRight })
);
}
// ---- The other panels: created and deleted as the Panels setting changes ----
const panelBuilders = {
// A gauge for the one number people check first
async gauge() {
const MIN = 0, MAX = 120, SWEEP = (240 * Math.PI) / 180;
const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(ui.cells.gauge, surfaceOptions("Line speed (units/min)"));
sciChartSurface.xAxes.add(
new PolarNumericAxis(wasmContext, {
polarAxisMode: EPolarAxisMode.Angular,
visibleRange: new NumberRange(MIN, MAX),
totalAngle: SWEEP,
startAngle: (Math.PI - SWEEP) / 2,
flippedCoordinates: true,
autoTicks: false,
majorDelta: 20,
drawMajorGridLines: false,
drawMinorGridLines: false,
drawMajorBands: false,
labelStyle: { fontSize: 12, color: "#C8D2E0" },
labelPrecision: 0
})
);
sciChartSurface.yAxes.add(new PolarNumericAxis(wasmContext, { polarAxisMode: EPolarAxisMode.Radial, visibleRange: new NumberRange(0, 10), isVisible: false }));
const arc = (x1, x2, fill, inner = 7, outer = 9.5) =>
new PolarArcAnnotation({ x1, x2, y1: outer, y2: inner, fill, stroke: "#00000000", strokeThickness: 0 });
// Thin bands mark low and high speed; the thick arc fills up to the current value
sciChartSurface.annotations.add(
arc(MIN, MAX, "#FFFFFF14"),
arc(MIN, 60, "#E8505B", 9.7, 10),
arc(60, 110, "#3CBF7E", 9.7, 10),
arc(110, MAX, "#F5B83D", 9.7, 10)
);
const valueArc = arc(MIN, MIN, "#50C7E0");
const straightDown = MAX + (MAX - MIN) * 0.25; // past the end of the scale, so the text sits in the gap
const readout = new NativeTextAnnotation({
x1: straightDown, y1: 1.5, fontSize: 30, textColor: "#FFFFFF",
horizontalAnchorPoint: EHorizontalAnchorPoint.Center, verticalAnchorPoint: EVerticalAnchorPoint.Center
});
sciChartSurface.annotations.add(valueArc, readout);
return {
surfaces: [sciChartSurface],
points: () => 1,
update: (records) => {
const speed = records[records.length - 1].lineSpeed;
valueArc.x2 = Math.min(MAX, Math.max(MIN, speed));
valueArc.fill = speed < 60 ? "#E8505B" : speed > 110 ? "#F5B83D" : "#50C7E0";
readout.text = speed.toFixed(0);
}
};
},
// Bars for current values that are compared with each other
async bars() {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(ui.cells.bars, surfaceOptions("Output by station (units/min)"));
const xAxis = new NumericAxis(wasmContext, { autoTicks: false, majorDelta: 1, drawMajorGridLines: false, drawMinorGridLines: false, visibleRange: new NumberRange(0.4, 6.6) });
xAxis.labelProvider.formatLabel = (x) => `S${x}`;
sciChartSurface.xAxes.add(xAxis);
sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { autoRange: EAutoRange.Never, visibleRange: new NumberRange(0, 30), autoTicks: false, majorDelta: 10, minorDelta: 5, labelPrecision: 0, drawMinorGridLines: false }));
const dataSeries = new XyDataSeries(wasmContext, { xValues: [1, 2, 3, 4, 5, 6], yValues: [20, 21, 19, 22, 20, 21], dataSeriesName: "Output", isSorted: true, containsNaN: false });
sciChartSurface.renderableSeries.add(
new FastColumnRenderableSeries(wasmContext, {
dataSeries,
fill: "#50C7E0CC",
stroke: "#50C7E0",
strokeThickness: 2,
dataPointWidth: 0.7,
cornerRadius: 8,
dataLabels: { color: "#FFFFFF", style: { fontSize: 15, fontFamily: "Arial" }, precision: 0, positionMode: EColumnDataLabelPosition.Inside }
})
);
// The target, so each bar is read against it
sciChartSurface.annotations.add(
new HorizontalLineAnnotation({ y1: 18, stroke: "#F6E05E", strokeThickness: 2, strokeDashArray: [6, 4], showLabel: true, labelValue: "Target 18", axisLabelFill: "#F6E05E" })
);
return {
surfaces: [sciChartSurface],
points: () => 6,
update: (records) => records[records.length - 1].stations.forEach((value, i) => dataSeries.update(i, value))
};
},
// Sparklines: trend and latest value, no axes
async sparklines() {
const specs = [
{ title: "Power (kW)", range: new NumberRange(36, 52), digits: 1 },
{ title: "Reject rate (%)", range: new NumberRange(0.5, 2.5), digits: 2 },
{ title: "Air pressure (bar)", range: new NumberRange(5.9, 6.5), digits: 2 },
{ title: "Coolant flow (L/min)", range: new NumberRange(20, 28), digits: 1 }
];
const sparks = [];
for (const [i, spec] of specs.entries()) {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(ui.sparklineCells[i], surfaceOptions(spec.title));
sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { isVisible: false, autoRange: EAutoRange.Always }));
sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { isVisible: false, autoRange: EAutoRange.Never, visibleRange: spec.range }));
const dataSeries = new XyDataSeries(wasmContext, { fifoCapacity: SLOW_POINTS, isSorted: true, containsNaN: false });
sciChartSurface.renderableSeries.add(new FastLineRenderableSeries(wasmContext, { dataSeries, stroke: "#50C7E0", strokeThickness: 2 }));
const latest = new NativeTextAnnotation({
xCoordinateMode: ECoordinateMode.Relative, yCoordinateMode: ECoordinateMode.Relative,
x1: 1, y1: 0, fontSize: 18, textColor: "#FFFFFF",
horizontalAnchorPoint: EHorizontalAnchorPoint.Right, verticalAnchorPoint: EVerticalAnchorPoint.Top
});
sciChartSurface.annotations.add(latest);
sparks.push({ sciChartSurface, dataSeries, latest, spec });
}
return {
surfaces: sparks.map((s) => s.sciChartSurface),
points: () => sparks.reduce((sum, s) => sum + s.dataSeries.count(), 0),
update: (records) => {
sparks.forEach((spark, i) => {
spark.dataSeries.appendRange(records.map((r) => r.t), records.map((r) => r.utilities[i]));
spark.latest.text = records[records.length - 1].utilities[i].toFixed(spark.spec.digits);
});
}
};
},
// A heatmap: many sensors over time, in one picture
async heatmap() {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(ui.cells.heatmap, surfaceOptions("Oven zones (°C), last 30 s"));
sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { visibleRange: new NumberRange(-WINDOW, 0), maxAutoTicks: 4, drawMajorGridLines: false, drawMinorGridLines: false, axisTitle: "Seconds ago", axisTitleStyle: { fontSize: 12 } }));
const yAxis = new NumericAxis(wasmContext, { visibleRange: new NumberRange(0.5, 8.5), autoTicks: false, majorDelta: 1, drawMajorGridLines: false, drawMinorGridLines: false });
yAxis.labelProvider.formatLabel = (y) => `Z${y}`;
sciChartSurface.yAxes.add(yAxis);
const zValues = Array.from({ length: 8 }, () => new Array(SLOW_POINTS).fill(NaN)); // [zone][time]
const dataSeries = new UniformHeatmapDataSeries(wasmContext, { xStart: -WINDOW, xStep: plant.SLOW_STEP, yStart: 1, yStep: 1, zValues });
sciChartSurface.renderableSeries.add(
new UniformHeatmapRenderableSeries(wasmContext, {
dataSeries,
colorMap: new HeatmapColorMap({
minimum: 175,
maximum: 230,
gradientStops: [
{ offset: 0, color: "#14233C" },
{ offset: 0.35, color: "#1F6F94" },
{ offset: 0.65, color: "#50C7E0" },
{ offset: 0.85, color: "#F6E05E" },
{ offset: 1, color: "#EF5350" }
]
})
})
);
return {
surfaces: [sciChartSurface],
points: () => 8 * SLOW_POINTS,
update: (records) => {
// Scroll every row left by the new columns, and add the new readings at the right
for (const record of records) {
zValues.forEach((row, zone) => {
row.shift();
row.push(record.zones[zone]);
});
}
dataSeries.setZValues(zValues);
}
};
}
};
const panels = new Map(); // the panels currently on screen, by name
let slowHistory = []; // the last 30 s of slow values, to fill a panel when it is added
async function setPanels(count) {
ui.showPanels(count);
const wanted = { 2: [], 4: ["gauge", "bars"], 6: ["gauge", "bars", "sparklines", "heatmap"] }[count];
for (const [name, panel] of panels) {
if (!wanted.includes(name)) {
panel.surfaces.forEach((surface) => surface.delete());
panels.delete(name);
}
}
for (const name of wanted) {
if (panels.has(name)) continue;
const panel = await panelBuilders[name]();
if (slowHistory.length) panel.update(slowHistory);
panels.set(name, panel);
}
}
// ---- The data path: arrivals go into a buffer; the dashboard drains it at the update rate ----
// Fast readings arrive in small batches, as they would from a WebSocket. Typed arrays keep them compact.
let buffer = []; // batches of { x, y: [4 channels] } not yet drawn
let buffered = 0;
let slowBuffer = [];
let nextSlow = WINDOW; // time of the next slow reading
let lastArrival = performance.now();
for (let t = 0; t < WINDOW; t += plant.SLOW_STEP) slowHistory.push({ t, ...plant.slow(t) }); // 30 s of history
function receive() {
const wall = performance.now();
const elapsed = Math.min(wall - lastArrival, 250) / 1000; // capped if the tab was hidden
lastArrival = wall;
const count = Math.round(elapsed * dataRate);
if (count > 0) {
const x = new Float64Array(count);
const y = [0, 1, 2, 3].map(() => new Float64Array(count));
for (let i = 0; i < count; i++) {
const t = now + (i + 1) / dataRate;
x[i] = t;
plant.fast(t).forEach((v, c) => (y[c][i] = v));
}
buffer.push({ x, y });
buffered += count;
// While paused, keep only the newest window of data: older points would scroll off anyway
while (buffered - buffer[0].x.length >= dataRate * WINDOW) buffered -= buffer.shift().x.length;
}
now += count / dataRate;
for (; nextSlow <= now; nextSlow += plant.SLOW_STEP) {
slowBuffer.push({ t: nextSlow, ...plant.slow(nextSlow) });
if (slowBuffer.length > SLOW_POINTS) slowBuffer.shift();
}
}
// One update: append everything received since the last one, in one appendRange per series, then scroll
let isPaused = false;
let lastUpdateTime = Date.now();
let drawnUpTo = WINDOW;
function update() {
if (isPaused) return;
if (buffered > 0) {
const x = new Float64Array(buffered);
const y = [0, 1, 2, 3].map(() => new Float64Array(buffered));
let offset = 0;
for (const batch of buffer) {
x.set(batch.x, offset);
batch.y.forEach((values, c) => y[c].set(values, offset));
offset += batch.x.length;
}
let channel = 0;
strips.forEach((strip) => strip.dataSeries.forEach((series) => series.appendRange(x, y[channel++])));
drawnUpTo = x[x.length - 1];
buffer = [];
buffered = 0;
}
if (slowBuffer.length) {
panels.forEach((panel) => panel.update(slowBuffer));
slowHistory = slowHistory.concat(slowBuffer).slice(-SLOW_POINTS);
slowBuffer = [];
}
const range = new NumberRange(drawnUpTo - WINDOW, drawnUpTo);
strips.forEach((strip) => (strip.xAxis.visibleRange = range));
lastUpdateTime = Date.now();
}
const arrivalTimer = setInterval(receive, 16);
let updateTimer = setInterval(update, 1000 / Number(ui.updateSelect.value));
// ---- Controls ----
const setPaused = (paused) => {
isPaused = paused;
ui.pauseButton.textContent = paused ? "Resume" : "Pause";
if (!paused) update(); // catch up with the live data
};
ui.pauseButton.addEventListener("click", () => setPaused(!isPaused));
// Zooming or panning a strip chart pauses the dashboard, so the next update doesn't undo it
for (const strip of strips) {
strip.sciChartSurface.domChartRoot.addEventListener("wheel", () => !isPaused && setPaused(true));
strip.sciChartSurface.domChartRoot.addEventListener("pointerdown", () => !isPaused && setPaused(true));
}
ui.updateSelect.addEventListener("change", () => {
clearInterval(updateTimer);
updateTimer = setInterval(update, 1000 / Number(ui.updateSelect.value));
});
ui.dataSelect.addEventListener("change", () => {
dataRate = Number(ui.dataSelect.value);
buffer = [];
buffered = 0;
createFastSeries(); // new buffers sized for the new rate, filled with the last 30 s
drawnUpTo = now;
update();
});
ui.panelsSelect.addEventListener("change", () => setPanels(Number(ui.panelsSelect.value)));
// ---- Readout: frame time, points drawn and when the data was last updated ----
let frames = 0;
let frameStart = performance.now();
let frameTime = 0;
let animationFrame = requestAnimationFrame(function countFrame() {
frames++;
animationFrame = requestAnimationFrame(countFrame);
});
const readoutTimer = setInterval(() => {
const wall = performance.now();
frameTime = (wall - frameStart) / Math.max(frames, 1);
frames = 0;
frameStart = wall;
const fastPoints = strips.reduce((sum, strip) => sum + strip.dataSeries.reduce((s, series) => s + series.count(), 0), 0);
const points = fastPoints + [...panels.values()].reduce((sum, panel) => sum + panel.points(), 0);
const charts = strips.length + [...panels.values()].reduce((sum, panel) => sum + panel.surfaces.length, 0);
const behind = Math.round((Date.now() - lastUpdateTime) / 1000);
ui.readout.textContent =
`Frame time ${frameTime.toFixed(1)} ms · ${points.toLocaleString("en")} points drawn on ${charts} charts · ` +
`${(dataRate * 4).toLocaleString("en")} points/s in · ` +
(isPaused ? `Paused, ${behind} s behind live` : `Updated ${new Date(lastUpdateTime).toLocaleTimeString("en-GB")}`);
}, 500);
strips[0].sciChartSurface.addDeletable({
delete: () => {
clearInterval(arrivalTimer);
clearInterval(updateTimer);
clearInterval(readoutTimer);
cancelAnimationFrame(animationFrame);
}
});
await setPanels(Number(ui.panelsSelect.value));
update();
import { useEffect, useRef } from "react";
import { SciChartReact } from "scichart-react";
import {
SciChartSurface,
SciChartVerticalGroup,
NumericAxis,
NumberRange,
EAutoRange,
EXyDirection,
FastLineRenderableSeries,
XyDataSeries,
SciChartJsNavyTheme,
CursorModifier,
MouseWheelZoomModifier,
ZoomPanModifier
} from "scichart";
const WINDOW = 30; // seconds on screen
const DATA_RATE = 1000; // readings per second, per channel
const UPDATE_RATE = 10; // dashboard updates per second
const group = new SciChartVerticalGroup(); // lines up the y-axes, so both time axes match
// One strip chart: a fixed y-range, a circular buffer, and a cursor shared with the other chart
const stripChart = (title: string, yRange: NumberRange) => async (rootElement: string | HTMLDivElement) => {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(rootElement, {
theme: new SciChartJsNavyTheme(),
title
});
const xAxis = new NumericAxis(wasmContext, { autoRange: EAutoRange.Never });
sciChartSurface.xAxes.add(xAxis);
sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { autoRange: EAutoRange.Never, visibleRange: yRange }));
const dataSeries = new XyDataSeries(wasmContext, { fifoCapacity: WINDOW * DATA_RATE, isSorted: true, containsNaN: false });
sciChartSurface.renderableSeries.add(new FastLineRenderableSeries(wasmContext, { dataSeries, stroke: "#50C7E0" }));
sciChartSurface.chartModifiers.add(
new CursorModifier({ modifierGroup: "dashboard", showTooltip: true }),
new MouseWheelZoomModifier({ xyDirection: EXyDirection.XDirection }),
new ZoomPanModifier({ xyDirection: EXyDirection.XDirection })
);
group.addSurfaceToGroup(sciChartSurface);
return { sciChartSurface, xAxis, dataSeries };
};
const initCurrent = stripChart("Motor current (A)", new NumberRange(0, 40));
const initVibration = stripChart("Vibration (mm/s)", new NumberRange(-12, 12));
export const RealTimeDashboard = () => {
const charts = useRef<{ xAxis: NumericAxis; dataSeries: XyDataSeries }[]>([]);
useEffect(() => {
// Buffer readings as they arrive; draw them in one batch per update
let times: number[] = [];
let values: number[][] = [[], []];
const unsubscribe = subscribeToYourStream((time: number, reading: number[]) => {
times.push(time);
reading.forEach((value, i) => values[i].push(value));
});
const timer = setInterval(() => {
if (times.length === 0 || charts.current.length < 2) return;
charts.current.forEach((chart, i) => chart.dataSeries.appendRange(times, values[i]));
const now = times[times.length - 1];
charts.current.forEach((chart) => (chart.xAxis.visibleRange = new NumberRange(now - WINDOW, now)));
times = [];
values = [[], []];
}, 1000 / UPDATE_RATE);
return () => {
clearInterval(timer);
unsubscribe();
};
}, []);
return (
<div style={{ display: "grid", gridTemplateRows: "1fr 1fr", gap: 6, height: 500 }}>
<SciChartReact initChart={initCurrent} onInit={(result) => (charts.current[0] = result)} />
<SciChartReact initChart={initVibration} onInit={(result) => (charts.current[1] = result)} />
</div>
);
};
import { Component, OnDestroy, OnInit } from "@angular/core";
import { ScichartAngularComponent } from "scichart-angular";
import {
SciChartSurface,
SciChartVerticalGroup,
NumericAxis,
NumberRange,
EAutoRange,
EXyDirection,
FastLineRenderableSeries,
XyDataSeries,
SciChartJsNavyTheme,
CursorModifier,
MouseWheelZoomModifier,
ZoomPanModifier
} from "scichart";
const WINDOW = 30; // seconds on screen
const DATA_RATE = 1000; // readings per second, per channel
const UPDATE_RATE = 10; // dashboard updates per second
@Component({
selector: "app-real-time-dashboard",
standalone: true,
imports: [ScichartAngularComponent],
template: `
<div style="display: grid; grid-template-rows: 1fr 1fr; gap: 6px; height: 500px">
<scichart-angular [initChart]="initCurrent"></scichart-angular>
<scichart-angular [initChart]="initVibration"></scichart-angular>
</div>`
})
export class RealTimeDashboardComponent implements OnInit, OnDestroy {
private group = new SciChartVerticalGroup(); // lines up the y-axes, so both time axes match
private charts: { xAxis: NumericAxis; dataSeries: XyDataSeries }[] = [];
private times: number[] = [];
private values: number[][] = [[], []];
private timer?: ReturnType<typeof setInterval>;
private unsubscribe?: () => void;
// One strip chart: a fixed y-range, a circular buffer, and a cursor shared with the other chart
private stripChart = (index: number, title: string, yRange: NumberRange) => async (rootElement: string | HTMLDivElement) => {
const { sciChartSurface, wasmContext } = await SciChartSurface.create(rootElement, {
theme: new SciChartJsNavyTheme(),
title
});
const xAxis = new NumericAxis(wasmContext, { autoRange: EAutoRange.Never });
sciChartSurface.xAxes.add(xAxis);
sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { autoRange: EAutoRange.Never, visibleRange: yRange }));
const dataSeries = new XyDataSeries(wasmContext, { fifoCapacity: WINDOW * DATA_RATE, isSorted: true, containsNaN: false });
sciChartSurface.renderableSeries.add(new FastLineRenderableSeries(wasmContext, { dataSeries, stroke: "#50C7E0" }));
sciChartSurface.chartModifiers.add(
new CursorModifier({ modifierGroup: "dashboard", showTooltip: true }),
new MouseWheelZoomModifier({ xyDirection: EXyDirection.XDirection }),
new ZoomPanModifier({ xyDirection: EXyDirection.XDirection })
);
this.group.addSurfaceToGroup(sciChartSurface);
this.charts[index] = { xAxis, dataSeries };
return { sciChartSurface };
};
initCurrent = this.stripChart(0, "Motor current (A)", new NumberRange(0, 40));
initVibration = this.stripChart(1, "Vibration (mm/s)", new NumberRange(-12, 12));
ngOnInit() {
// Buffer readings as they arrive; draw them in one batch per update
this.unsubscribe = subscribeToYourStream((time: number, reading: number[]) => {
this.times.push(time);
reading.forEach((value, i) => this.values[i].push(value));
});
this.timer = setInterval(() => {
if (this.times.length === 0 || this.charts.length < 2) return;
this.charts.forEach((chart, i) => chart.dataSeries.appendRange(this.times, this.values[i]));
const now = this.times[this.times.length - 1];
this.charts.forEach((chart) => (chart.xAxis.visibleRange = new NumberRange(now - WINDOW, now)));
this.times = [];
this.values = [[], []];
}, 1000 / UPDATE_RATE);
}
ngOnDestroy() {
clearInterval(this.timer);
this.unsubscribe?.();
}
}
Key points:
- Each panel is its own
SciChartSurface(the gauge is aSciChartPolarSurface).SciChartSurface.createdraws every chart with one shared rendering engine (one GPU device under WebGPU, or one WebGL context under WebGL 2), which keeps memory low and lets one page hold many charts. XyDataSerieswithfifoCapacityis a circular buffer: it keeps the newest points and drops the oldest. Readings arrive intoFloat64Arraybatches and are added with oneappendRangeper series per update, so the update rate is set by a timer, independently of the data rate.SciChartVerticalGroupgives the strip charts' y-axes the same width, so their time axes line up; avisibleRangeChangedhandler copies zooming and panning from one to the other, andCursorModifierwith a sharedmodifierGroupshows the cursor on both.- The gauge is a
PolarArcAnnotationwhose end moves to the latest value; the bars update in place withXyDataSeries.update; the heatmap scrolls by shifting its rows and callingUniformHeatmapDataSeries.setZValues. freezeWhenOutOfViewstops drawing panels scrolled off screen, and fixedvisibleRanges withEAutoRange.Neverkeep every axis still.
See it in the demo app: JavaScript multi-chart dashboard · React multi-chart dashboard · Angular multi-chart dashboard. For synchronised charts, see the React synchronised multi-chart example; for a monitoring screen, the React server traffic dashboard; for gauges fed with live data, the React polar gauge FIFO dashboard; for raw speed, the React real-time performance demo; and for full industry screens, the React oil and gas dashboard and the React vital signs monitor.
Go deeper: SciChart.js chart synchronisation documentation, real-time updates, performance tips for many charts, polar gauge chart and updating a heatmap in real time. For where SciChart is used in industry, see the HMI and SCADA page, the medical charts page and the instrumentation page.
Frequently asked questions
What is a real-time dashboard?
A real-time dashboard is a screen of charts, gauges and numbers that updates by itself as new data arrives, usually within a second or a few seconds of each event. It is used to watch something while it is happening, such as a production line, a fleet of sensors, a patient or a website, so people can act before a problem grows.
What is the difference between a real-time dashboard and a BI dashboard?
A BI (business intelligence) dashboard is refreshed on a schedule, often hourly or daily, from a data warehouse, and answers questions about trends and totals. A real-time dashboard is pushed new data continuously from live sources and answers what is happening now. Many operations teams use both: the live view to act, the BI view to review.
How often should a real-time dashboard update?
Match the update rate to the decision and to the chart. Moving traces such as strip charts look smooth when they update with the screen, up to 60 times a second on most displays. Numbers and gauges that people read are easier to follow at one to a few updates a second. Business metrics can update every few seconds or every minute. Updating faster than the screen refreshes does nothing but cost processing time.
How does data get into a real-time dashboard?
Devices and applications publish readings to a broker or server, often over MQTT or a message queue. The server processes and stores them, then pushes new values to each open dashboard over a WebSocket or server-sent events, or the dashboard polls for them. In the browser, the readings are buffered and appended to the charts at the dashboard's update rate.
What is an IoT dashboard?
An IoT dashboard shows live readings from internet-connected devices such as sensors, meters and machines. It typically combines a list or map of devices and their status, sparklines or strip charts of each device's recent readings, gauges for key values and an alarm list. Devices usually send data through an MQTT broker or a cloud IoT service.
How do I make a real-time dashboard in JavaScript?
Use a charting library built for live data. In SciChart.js, create one SciChartSurface per panel (they share one GPU device under WebGPU, or one WebGL context under the WebGL 2 fallback), give each line an XyDataSeries with fifoCapacity, buffer incoming readings and append them with appendRange on a timer at your update rate, then move the time axes together. SciChartVerticalGroup and a CursorModifier modifierGroup keep the charts aligned and their cursors in step.
Sources
- Fette, I. and Melnikov, A. (2011), RFC 6455: The WebSocket Protocol, Internet Engineering Task Force.
- WHATWG, HTML Living Standard: server-sent events.
- OASIS (2019), MQTT Version 5.0, OASIS Standard.
- Shneiderman, B. (1996), "The Eyes Have It: A Task by Data Type Taxonomy for Information Visualizations", Proceedings of the IEEE Symposium on Visual Languages, doi:10.1109/VL.1996.545307.
- International Society of Automation, ANSI/ISA-101.01-2015, Human Machine Interfaces for Process Automation Systems.
- MDN Web Docs, Window: requestAnimationFrame() method (paused in background tabs) and Float64Array.