JavaScript Chart Data Animation

Demonstrates how to run Dataset Animations using SciChart.js, High Performance JavaScript Charts

Fullscreen

Edit

 Edit

Docs

drawExample.ts

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

Data Animation Example - JavaScript

Overview

The Data Animation Example demonstrates how to implement real-time dataset animations with SciChart.js using JavaScript. This example initializes a SciChartSurface asynchronously and dynamically updates chart data with smooth animated transitions, making it ideal for high-performance WebGL visualizations.

Technical Implementation

The chart is created by asynchronously initializing the SciChartSurface using async/await, a pattern explained in Async and Await in JavaScript. It configures NumericAxis objects with specific visible ranges set by NumberRange to control the chart axes. The data is managed through an XyDataSeries and rendered with a FastLineRenderableSeries, which incorporates a custom EllipsePointMarker for enhanced visual emphasis. Real-time data updates are achieved via a looping setTimeout function that adjusts the data and triggers a ScatterAnimation to animate these changes.

Features and Capabilities

This example highlights several advanced features and customizations: the use of dynamic, randomized data updates that enable smooth animated transitions; advanced styling with a gradient palette applied through PaletteFactory and gradient parameters; and custom point markers providing greater visual clarity. These capabilities are engineered for high-performance, real-time updates while ensuring efficient data handling.

Integration and Best Practices

Even though this implementation is in JavaScript, it adheres to best practices applicable across various frameworks. The asynchronous initialization ensures that the chart setup is non-blocking, as illustrated in the asynchronous patterns from Async and Await in JavaScript. The implementation also emphasizes proper resource management and cleanup, following resource management guidelines to prevent memory leaks by disposing of the SciChartSurface appropriately. Finally, developers can consult the Performance Tips & Tricks documentation to further optimize real-time dataset animations in their applications.

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