JavaScript Chart with Vertically Stacked Axes

Vertically-Stacked Axis in SciChart.js allows several traces with independent Y-axis to be placed on the same chart, stacking the Y-Axis and enabling an ECG/EEG-style trace. Great for neurological apps, medical apps, earthquake monitoring.

Fullscreen

Edit

 Edit

Docs

drawExample.ts

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

Vertically Stacked Axes Example with JavaScript

Overview

This example demonstrates how to create a high-performance chart using SciChart.js with JavaScript. It showcases a custom setup where multiple independent Y-axes are vertically stacked to allow overlapping data traces similar to ECG/EEG visualizations. The chart is initialized asynchronously and leverages native JavaScript for a straightforward integration in web applications.

Technical Implementation

The chart is created by calling SciChartSurface.create() asynchronously, ensuring that the WebAssembly context is fully loaded before rendering. A custom axis layout is implemented using the LeftAlignedOuterVerticallyStackedAxisLayoutStrategy as described in the Vertically Stacked Axis Layout documentation. Each data series is associated with its own Y-axis, configured with a specific visible range and border styling. Data for each series is generated dynamically using a sine wave algorithm via the XyDataSeries, which aligns with best practices as shown in the Tutorial on Adding Series and Data. In addition, multiple interactive modifiers such as YAxisDragModifier, XAxisDragModifier, RubberBandXyZoomModifier, and MouseWheelZoomModifier are added to enhance user interactivity.

Features and Capabilities

The example emphasizes several advanced features:

  • Multiple Y-Axes: Each data trace is plotted against its own Y-axis, enabling a stacked layout that is ideal for overlapping visualizations.
  • High-Performance Rendering: The use of FastLineRenderableSeries ensures smooth rendering of large data sets. More details can be found in the FastLineRenderableSeries API Documentation.
  • Interactive Modifiers: Advanced interactivity is provided through drag and zoom modifiers, allowing dynamic exploration of the chart.
  • Annotations: A text annotation is incorporated using NativeTextAnnotation to offer contextual information directly on the chart.

Integration and Best Practices

This implementation is a prime example of integrating SciChart.js with JavaScript. Developers can follow the asynchronous initialization pattern and proper lifecycle management evidenced by the cleanup function which calls sciChartSurface.delete(). For more information on JavaScript integration, refer to the Getting Started with SciChart JS guide. Additionally, proper memory management and disposal practices are covered in the Deleting DataSeries Memory documentation. By adopting these techniques, developers can ensure optimal performance and maintainability in their web applications.

javascript Chart Examples & Demos

See Also: Scientific & Medical Charts (10 Demos)

JavaScript Vital Signs ECG/EKG Medical Demo | SciChart.js

JavaScript Vital Signs ECG/EKG Medical Demo

In this example we are simulating four channels of data showing that SciChart.js can be used to draw real-time ECG/EKG charts and graphs to monitor heart reate, body temperature, blood pressure, pulse rate, SPO2 blood oxygen, volumetric flow and more.

JavaScript Chart with Logarithmic Axis Example | SciChart

JavaScript Chart with Logarithmic Axis Example

Demonstrates Logarithmic Axis on a JavaScript Chart using SciChart.js. SciChart supports logarithmic axis with scientific or engineering notation and positive and negative values

LiDAR 3D Point Cloud of Geospatial Data | SciChart.js

LiDAR 3D Point Cloud of Geospatial Data

Demonstrating the capability of SciChart.js to create JavaScript 3D Point Cloud charts and visualize LiDAR data from the UK Defra Survey.

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.

Realtime Audio Analyzer Bars Demo | SciChart.js Demo

Realtime Audio Analyzer Bars Demo

Demonstrating the capability of SciChart.js to create a JavaScript Audio Analyzer Bars and visualize the Fourier-Transform of an audio waveform in realtime.

Interactive Waterfall Chart | Javascript Charts | SciChart.js

Interactive Waterfall Spectral Chart

Demonstrates how to create a Waterfall chart in SciChart.js, showing chromotragraphy data with interactive selection of points.

Interactive Phasor Diagram chart | Javascript Charts | SciChart.js

Phasor Diagram Chart Example

See the JavaScript Phasor Diagram example to combine a Cartesian surface with a Polar subsurface. Get seamless JS integration with SciChart. View demo now.

NEW!
JavaScript Correlation Plot | Javascript Charts | SciChart.js

JavaScript Correlation Plot

Create JavaScript Correlation Plot with high performance SciChart.js. Easily render pre-defined point types. Supports custom shapes. Get your free trial now.

NEW!
Semiconductors Dashboard | JavaScript Charts | SciChart.js

Semiconductors Dashboard

JavaScript **Semiconductors Dashboard** using SciChart.js, by leveraging the **FastRectangleRenderableSeries**, and its `customTextureOptions` property to have a custom tiling texture fill.

NEW!
Wafer Analysis Chart | JavaScript Charts | SciChart.js

Wafer Analysis Chart

JavaScript **Wafer Analysis Chart** using SciChart.js, by leveraging the **FastRectangleRenderableSeries**, and crossfilter to enable live filtering.

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