Client/Server Websocket Data Streaming

Demonstrates handling realtime big data with different chart types using SciChart.js, High Performance JavaScript Charts

Number of Series 10

Initial Points 10000

Max Points On Chart 10000

Points Per Update 10

Send Data Interval 100 ms

Fullscreen

Edit

 Edit

Docs

drawExample.ts

Copy to clipboard
Minimise
Fullscreen
1// Loading ... 

Websocket Big Data Example - JavaScript

Overview

This example demonstrates how to create a high performance real-time chart using SciChart.js integrated with websocket streaming data in a JavaScript environment. It showcases efficient handling and visualization of massive datasets by employing data buffering and a sliding window pattern to update the chart dynamically.

Technical Implementation

The chart is initialized using the native SciChart.js API via the call to SciChartSurface.create, which sets up the rendering surface with WebGL acceleration. Data management is handled by appending new data points using methods like appendRange() and removing older data using removeRange(), thereby implementing a sliding window for continuous updates. This technique could be further improved by using fifoCapacity - where XyDataSeries are implemented with a First-In-First-Out (FIFO) circular buffer, for automatic discarding of old data. For more information on these techniques, refer to the Append, Insert, Update, Remove documentation and the Performance Tips & Tricks.

Features and Capabilities

The example supports multiple chart series types—including FastLineRenderableSeries, FastColumnRenderableSeries, StackedMountainRenderableSeries, FastBandRenderableSeries, XyScatterRenderableSeries, and FastCandlestickRenderableSeries that can be dynamically selected. It also implements logarithmic scaling through custom slider components built with Math.log10. Real-time data updates are achieved using socket.io, which streams data from a backend websocket server. Additionally, performance metrics such as load time and render time are captured using preRender and rendered event subscriptions, enabling calculation of the maximum frames per second (FPS).

Integration and Best Practices

Built entirely with JavaScript, this example offers an in-depth look at integrating real-time websocket data with SciChart.js without any additional frameworks. Developers interested in leveraging similar techniques can start with the Getting Started with SciChart JS guide. For robust websocket handling—including reconnection strategies and buffer management—practices are illustrated in discussions such as How to reconnect to websocket after close connection.

This example stands as a comprehensive resource for integrating high performance real-time charting with scattered and rapid data updates in a lightweight, framework-free JavaScript environment.

javascript Chart Examples & Demos

See Also: Performance Demos & Showcases (12 Demos)

Realtime JavaScript Chart Performance Demo | SciChart.js

Realtime JavaScript Chart Performance Demo

This demo showcases the incredible realtime performance of our JavaScript charts by updating the series with millions of data-points!

Load 500 Series x 500 Points Performance Demo | SciChart

Load 500 Series x 500 Points Performance Demo

This demo showcases the incredible performance of our JavaScript Chart by loading 500 series with 500 points (250k points) instantly!

Load 1 Million Points Performance Demo | SciChart.js Demo

Load 1 Million Points Performance Demo

This demo showcases the incredible performance of our JavaScript Chart by loading a million points instantly.

Realtime Ghosted Traces | Javascript Charts | SciChart.js Demo

Realtime Ghosted Traces

This demo showcases the realtime performance of our JavaScript Chart by animating several series with thousands of data-points at 60 FPS

Realtime Audio Spectrum Analyzer Chart | SciChart.js Demo

Realtime Audio Spectrum Analyzer Chart Example

See the frequency of recordings with the JavaScript audio spectrum analyzer example from SciChart. This real-time visualizer demo uses a Fourier Transform.

Oil & Gas Explorer JavaScript Dashboard | SciChart.js

Oil & Gas Explorer JavaScript Dashboard

Demonstrates how to create Oil and Gas Dashboard

Server Traffic Dashboard | Javascript Charts | SciChart.js Demo

Server Traffic Dashboard

This dashboard demo showcases the incredible realtime performance of our JavaScript charts by updating the series with millions of data-points!

Rich Interactions Showcase | Javascript Charts | SciChart.js

Rich Interactions Showcase

This demo showcases the incredible realtime performance of our JavaScript charts by updating the series with millions of data-points!

Dynamic Layout Showcase | Javascript Charts | SciChart.js Demo

Dynamic Layout Showcase

Demonstrates a custom modifier which can convert from single chart to grid layout and back.

Dragabble Event Markers | Javascript Charts | SciChart.js Demo

Dragabble Event Markers

Demonstrates how to repurpose a Candlestick Series into dragabble, labled, event markers

JavaScript Population Pyramid | Javascript Charts | SciChart.js

JavaScript Population Pyramid

Population Pyramid of Europe and Africa

NEW!
High Performance SVG Cursor & Rollover | SciChart.js Demo

High Performance SVG Cursor & Rollover

Demonstrates how to use the SVG render layer in SciChart.js to maintain smooth cursor interaction on heavy charts with millions of points.

SciChart Ltd, 16 Beaufort Court, Admirals Way, Docklands, London, E14 9XL.