JavaScript Vital Signs ECG/EKG Medical Demo

Showcases how SciChart.js can be used in a Medical context, drawing ECGs with our High Performance JavaScript Charts

ECG
0
V1 - 1.4MM
ST | +0.6 || +0.9
NIBP
AUTO
145/95
0/0
SV
ML 100
%**** 55
0.0
SPO2
18:06
71-
RESP
0
drawExample.tsread-only
// Loading ... 

Vital Signs Monitor Demo in JavaScript

Overview

This example, titled Vital Signs Monitor Demo, showcases how to build a high-performance real-time medical chart using SciChart.js with JavaScript. It simulates multiple medical signals including ECG, blood pressure, blood volume, and blood oxygenation, and is optimized for continuous data streaming and efficient updates.

Technical Implementation

The demo initializes a SciChartSurface with a hidden shared CategoryAxis for cyclic data management, which is essential for using FIFO-sweeping mode. Data is continuously appended to multiple XyDataSeries via the appendRange() method, ensuring smooth real-time updates. The use of fifoCapacity and fifoSweeping mode (see DataSeries Realtime Updates) allows the series to wrap around once the specified capacity is reached, optimizing performance. Additionally, a recursive setTimeout loop simulates real-time data streaming, while a custom EventHandler is used to update an information panel with computed metrics. For more detail on real-time updates, refer to Adding Realtime Updates.

Features and Capabilities

Real-Time Data Streaming: The demo employs a setTimeout loop to periodically fetch and append data points, demonstrating efficient real-time updating using JavaScript.

Performance Optimization: By configuring properties like fifoCapacity and fifoSweeping, the example highlights how FIFO buffers improve performance and simplify code for ECG style wrap-around charts when handling large volumes of data. For further insights, see the Performance Tips & Tricks guide.

Axis Configuration and Layout: The example uses a hidden CategoryAxis on the X-axis and multiple NumericAxis Y-axes that are vertically stacked with the RightAlignedOuterVerticallyStackedAxisLayoutStrategy. This approach simplifies the synchronization of multiple data series. More information is available in the Vertically Stacked Axis documentation.

Custom Event Handling and Memory Management: Custom event handlers are implemented using the EventHandler class to update the UI with the latest metrics. Additionally, sciChartSurface.addDeletable() is used to automatically clean up these subscriptions, ensuring optimal resource management during the chart's lifecycle.

Integration and Best Practices

Even though this demo is built using JavaScript, the underlying principles and performance optimizations can be applied across various frameworks. It emphasizes best practices for real-time data visualization including efficient data appending, optimized axis configurations, and sustainable memory management. By following these techniques, developers can create responsive, high-performance charting applications using SciChart.js.