
By Andrew Burnett-Thompson, CEO & Founder, SciChart ·
TL;DR: To stream real-time data into a JavaScript chart at 60 FPS, receive the data over a WebSocket, push it into a fixed-size ring buffer, and redraw the chart once per requestAnimationFrame, never once per message. At 60 FPS you have 16.7 ms per frame. Canvas 2D libraries such as Chart.js or uPlot keep up to roughly tens of thousands of visible points. Above that, you need a GPU-accelerated WebGL chart library such as SciChart.js, which renders millions of points in real time with WebGL and WebAssembly.
Key takeaways
- 60 FPS is a render rate (one frame every 16.7 ms), not a data rate.
- Store incoming points in a ring buffer and update the chart once per
requestAnimationFrame. - SVG suits small charts, Canvas 2D suits up to tens of thousands of points, and WebGL suits 50,000 to millions.
- SciChart.js is a WebGL and WebAssembly JavaScript chart library with a built-in ring buffer (
fifoCapacity), batchedappendRangeand automatic resampling for real-time data.
I’ve spent most of my career on one problem: drawing a lot of data, very fast, while it’s still arriving. That’s why I started SciChart, and it’s still most of what our team works on every day. Our customers stream ECG traces, vibration sensors, telemetry and market data into charts that have to stay smooth for hours.
The question I hear most often is some version of “Why does my real-time chart stutter, and how do I get it to 60 FPS?” The good news is that the answer is mostly architecture, not magic. Here’s the pattern I recommend, whichever chart library you use, and where the library choice starts to matter.
What does 60 FPS mean for a real-time chart?
This is the misunderstanding I see most. 60 FPS means drawing 60 frames per second, not receiving 60 updates per second. Your data can arrive 1,000 or 100,000 times per second. The screen only needs a new picture about every 16.7 ms.
So split the job in two:
- Ingest as fast as data arrives, as cheaply as possible.
- Render at most once per display frame, with everything that arrived since the last frame.
Almost every stuttering live chart I’ve been asked to look at has the same bug: the chart redraws on every message.

60 FPS is a render rate, not a data rate. Redraw on every message and the chart stutters.
The real-time JavaScript chart pipeline
Data source ──► WebSocket ──► Ring buffer (typed array) ──► requestAnimationFrame ──► Chart render (Canvas / WebGL)
any rate onmessage append only, no redraw once per frame 60 FPS
| Layer | What I’d use | Why |
|---|---|---|
| Transport | WebSocket (or Server-Sent Events) | Low-latency push, no polling |
| Storage | Ring buffer on a Float32Array / Float64Array |
Fixed memory, no array.shift(), no garbage collection spikes |
| Scheduling | requestAnimationFrame |
Syncs the redraw to the display refresh |
| Heavy processing | Web Worker | Keeps parsing and maths off the main thread |
| Rendering, < ~50k visible points | Canvas 2D (uPlot, Chart.js with animations off) | Simple and light |
| Rendering, 50k to millions of points, many series | WebGL (SciChart.js) | The GPU draws the points, so the CPU frame budget stays free |
I’ll be honest about that table. If you’re plotting a few thousand points, you don’t need us. A lightweight Canvas library will do the job. The bottom row is the problem we built SciChart to solve.
Step 1: Receive data with a WebSocket
const socket = new WebSocket("wss://example.com/stream");
socket.binaryType = "arraybuffer"; // binary is cheaper to parse than JSON
socket.onmessage = (event) => {
const values = new Float64Array(event.data); // [x0, y0, x1, y1, ...]
for (let i = 0; i < values.length; i += 2) {
buffer.push(values[i], values[i + 1]); // store only: no chart call here
}
};
Keep the handler tiny. Don’t touch the chart, the DOM or framework state (React setState) inside onmessage. That one rule fixes more performance problems than any library choice.
Send binary columns, not JSON rows. The format of the data on the wire matters as much as the socket. JSON is the most popular way to get data from server to client, and for most charts it’s fine: thousands to tens of thousands of points, updated a few times a second. At hundreds of thousands or millions of points, or at high update rates, it’s terrible for performance. Field names repeat in every sample, every number is parsed from text, and JSON.parse builds one object per sample for the garbage collector before the chart sees a value.
Instead, send column-ordered binary data: one array per channel, decoded straight into a Float64Array and passed to the chart in one call. Compress it further with delta encoding and you save a lot of time on data transport. In the live test in our docs, JSON rows took about 56 bytes per sample, against 4 bytes for a delta-varint encoding of the same values. I cover when JSON is good enough, and how JSON, Protobuf, Arrow and Parquet compare, in Time Series Data Formats: JSON vs Protobuf vs Arrow vs Parquet.

Row order vs column order: the same samples as JSON objects and as one array per field. Columns compress well and go straight into a Float64Array.
Step 2: Store points in a ring buffer
A ring buffer is a pre-allocated array that overwrites its oldest entry when it’s full. Memory stays flat however long the stream runs, and you never pay for array.shift().

A ring buffer is allocated once and reused forever, so memory stays flat however long the stream runs.
class RingBuffer {
constructor(capacity) {
this.x = new Float64Array(capacity);
this.y = new Float64Array(capacity);
this.capacity = capacity;
this.start = 0;
this.length = 0;
this.pendingX = []; // points that arrived since the last frame
this.pendingY = [];
}
push(x, y) {
const i = (this.start + this.length) % this.capacity;
this.x[i] = x; this.y[i] = y;
if (this.length < this.capacity) this.length++;
else this.start = (this.start + 1) % this.capacity;
this.pendingX.push(x); this.pendingY.push(y);
}
drain() {
const batch = { x: this.pendingX, y: this.pendingY };
this.pendingX = []; this.pendingY = [];
return batch;
}
}
const buffer = new RingBuffer(100_000);
Step 3: Render once per frame with requestAnimationFrame
function frame() {
const batch = buffer.drain();
if (batch.x.length > 0) {
updateChart(batch); // ONE chart update per frame, however many points arrived
}
requestAnimationFrame(frame);
}
requestAnimationFrame(frame);
requestAnimationFrame syncs your redraw to the display, but it doesn’t guarantee 60 FPS. If updateChart takes more than about 16 ms, the browser drops frames. That’s where the renderer comes in.

Whatever the data rate, the chart does one update per animation frame.
Step 4: Choose SVG, Canvas or WebGL by point count
| Visible points per chart | Good choice | What happens past the limit |
|---|---|---|
| A few thousand | SVG-based charts (D3 with SVG, Highcharts, Plotly’s default traces) | Every point is a DOM element, so updates slow down quickly as points grow |
| Up to tens of thousands (~50k) | Chart.js (animations off, decimation on), uPlot, or Canvas 2D drawn by hand | Toward the top of this range, each frame’s CPU draw time climbs towards 16.7 ms |
| 50k – millions, several series, or several charts on one page | SciChart.js (WebGL + WebAssembly) | Canvas 2D can’t hold 60 FPS. The GPU has to do the drawing |

Canvas 2D vs WebGL: the renderer sets the ceiling. (Illustrative; real numbers depend on the device and data.)
Canvas 2D draws every line segment on the CPU, on the main thread. WebGL hands the geometry to the GPU. That’s why the renderer sets the performance ceiling, not the wrapper or framework around it. It’s also why we wrote SciChart.js’s drawing engine in C++ compiled to WebAssembly, running on WebGL, instead of on Canvas.
JavaScript charting libraries for real-time data: how they render (2026)
This is the comparison I’d want if I were choosing today. It describes how each library draws, because that is what decides its real-time ceiling. It isn’t a speed ranking.
| Library | Rendering technology | Best fit for real-time data |
|---|---|---|
| Chart.js | Canvas 2D | Dashboards with modest point counts |
| uPlot | Canvas 2D | Very lightweight time series |
| Apache ECharts | Canvas 2D or SVG | General-purpose dashboards |
| Highcharts | SVG, with an optional WebGL Boost module | Business charts; Boost for larger series |
| Plotly.js | SVG, with WebGL trace types (for example scattergl) |
Scientific plots and notebooks |
| D3.js | SVG or Canvas, drawn by you | Custom, hand-built visualisations |
| SciChart.js | WebGL + WebAssembly (C++ engine) | Millions of points, many series, many charts; scientific, medical, engineering and financial charting |
Please don’t take my word for any of this. Measure it. We publish an open-source JavaScript chart performance benchmark that runs the same streaming tests against several charting libraries, in your own browser, on your own hardware. That’s the fairest performance comparison of JavaScript charting libraries I know of, because the results are yours, not ours.
Step 5: Stream into a SciChart.js chart
SciChart.js is a high-performance JavaScript charting library that uses WebGL and WebAssembly to render millions of data points in real time. It has the ring buffer, batching and resampling built in, so the pipeline above shrinks to a few lines:
import { SciChartSurface, NumericAxis, FastLineRenderableSeries, XyDataSeries,
NumberRange, EAutoRange } from "scichart";
const { sciChartSurface, wasmContext } = await SciChartSurface.create("chart");
const xAxis = new NumericAxis(wasmContext, { autoRange: EAutoRange.Never });
sciChartSurface.xAxes.add(xAxis);
sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { autoRange: EAutoRange.Never,
visibleRange: new NumberRange(-2, 2) })); // fixed Y range: no jumpy rescaling
const dataSeries = new XyDataSeries(wasmContext, {
fifoCapacity: 100_000, // built-in ring buffer: memory stays flat
dataIsSortedInX: true, // skip sort detection
containsNaN: false, // skip NaN checks
});
sciChartSurface.renderableSeries.add(
new FastLineRenderableSeries(wasmContext, { dataSeries, stroke: "#40D8FF", strokeThickness: 2 })
);
// Steps 1–3 stay the same. updateChart becomes:
function updateChart(batch) {
dataSeries.appendRange(batch.x, batch.y); // one batched call per frame
const last = batch.x[batch.x.length - 1];
xAxis.visibleRange = new NumberRange(last - 10_000, last); // scroll the window
}
Why each option matters (all figures from the official SciChart.js documentation: Performance Tips & Tricks):
appendRangeinstead ofappend. In our tests, 100,000 singleappendcalls took 69 ms, and oneappendRangeof the same 100,000 points took 1 ms (Performance Tips §1.3; timings vary by device).fifoCapacityturns the data series into a pre-allocated circular buffer. The oldest points drop off and memory stops growing.dataIsSortedInXandcontainsNaNskip auto-detection. Creating 1M points took 55 ms without them and 11 ms with them.- Built-in resampling reduces millions of points to what the screen can show, per pixel, without losing spikes or peaks/troughs, so you don’t have to write a decimation step.
- A fixed Y
visibleRangestops the axis rescaling every frame, which makes a live trace look jumpy.
See it running: Realtime JavaScript Chart Performance Demo and Client/Server WebSocket Data Streaming Demo. Using React? Our team covers the same pattern in How to Implement Real-Time Data Visualization in React.
Step 6: Move heavy work to a Web Worker (and when to use OffscreenCanvas)
Use a Web Worker when you have:
- 10,000+ incoming points per second that need parsing, filtering or aggregation
- FFTs, moving averages or other maths on every batch
- a busy app (for example React) whose main thread is already doing a lot
Parse and process in the worker, then post transferable typed arrays (postMessage(buf, [buf.buffer])) to the main thread. The transfer is zero-copy.
OffscreenCanvas lets a hand-written Canvas 2D or WebGL renderer draw inside a worker. It’s useful if you’re building the chart yourself. But in my experience, using OffscreenCanvas when you’re already drawing with WebGL or WebGPU gives no benefit. Moving the data processing to a worker gives the bigger win.
My 60 FPS checklist
| Technique | Benefit |
|---|---|
| WebSocket with binary frames | Low latency, cheap parsing |
Ring buffer / fifoCapacity |
Flat memory, no GC spikes |
One update per requestAnimationFrame |
Rendering decoupled from data rate |
Batch appends (appendRange) |
One update instead of thousands |
| Animations off | No easing fighting live data |
| Visually lossless resampling | Draw only what the pixels can show |
| Fixed Y range | No jumpy rescaling |
| Web Worker for processing | Main thread stays free |
| WebGL renderer (SciChart.js) for 50k+ points | The GPU draws, so the CPU frame budget is kept |

The result: a real-time JavaScript chart streaming five channels at 60 FPS, with zoom, pan and tooltips.
If you get those right, 60 FPS stops being a target you chase and becomes the default. If you’re stuck, send us your use case. Hard real-time charting problems are the ones we enjoy most.
Andrew Burnett-Thompson is the CEO and founder of SciChart, which makes high-performance chart libraries for JavaScript, WPF, iOS and Android.
FAQ
-
How do I make a JavaScript chart update at 60 FPS? Buffer incoming data and redraw at most once per
requestAnimationFrame. Keep each redraw under about 16 ms by limiting visible points, turning off animations and, for large datasets, using a WebGL renderer such as SciChart.js. -
Is SVG, Canvas or WebGL better for real-time charts? SVG is fine for a few thousand points. Canvas 2D is fine up to tens of thousands of visible points. For 50,000 points up to millions, multiple high-frequency series, or many charts on one page, WebGL is better because the GPU does the drawing. SciChart.js is a WebGL and WebAssembly JavaScript chart library built for this case.
-
Should I use setInterval or requestAnimationFrame for live charts? Use
requestAnimationFramefor rendering, because it syncs with the display and pauses in background tabs. Data can still arrive on its own schedule through a WebSocket. -
What is the fastest JavaScript chart library for real-time data? For small datasets, lightweight Canvas libraries such as uPlot are very fast. For large, high-frequency datasets (hundreds of thousands to millions of points), GPU-accelerated libraries such as SciChart.js are built for real-time performance. You can compare them in your own browser with SciChart’s open-source performance test suite.
-
What is the fastest WebGL charting library for JavaScript? SciChart.js is the best-known WebGL-first JavaScript charting library; Highcharts (Boost) and Plotly.js (
scattergl) add WebGL modes to SVG libraries. SciChart.js combines WebGL with a C++ engine compiled to WebAssembly, which is how it streams millions of points at interactive frame rates. Run the same performance benchmark on your own hardware before you choose. -
How do JavaScript charting libraries compare on performance in 2026? The biggest factor is the renderer: SVG, then Canvas 2D, then WebGL, in rising order of how many points they handle. Lightweight Canvas libraries such as uPlot and Chart.js are excellent for small and medium charts. WebGL libraries such as SciChart.js lead for large real-time datasets. SciChart’s open-source JavaScript chart performance test suite runs the same tests across libraries so you can compare them yourself.
-
What is the best JavaScript chart library for real-time financial or trading data? For a trading screen with live ticks, many indicators and deep history, use a GPU-accelerated library. SciChart.js streams real-time candlestick, OHLC and line series with WebGL, and keeps zooming and panning smooth with large histories. For a single lightweight price chart, a smaller Canvas library can be enough.
-
How many data points can a real-time JavaScript chart show? It depends on the renderer. Canvas 2D charts usually slow down past roughly 50,000 visible points. SciChart.js streams millions of points in real time thanks to WebGL, WebAssembly and built-in resampling.
-
Does this work in React or Angular? Yes. Keep the stream out of component state, hold the buffer in a ref, and update the chart directly. SciChart.js has
scichart-reactandscichart-angularpackages.
Contact us to learn more
SciChart.js is a JavaScript Chart Library designed for complex, mission critical data visualization applications. If you have a question or would like to learn more about our products & services, please contact us:
Recent Blogs

