JavaScript Startup Animation

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

Fullscreen

Edit

 Edit

Docs

drawExample.ts

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

JavaScript Startup Animation - JavaScript

Overview

This example demonstrates how to implement a series of startup animations using SciChart.js in a JavaScript environment. The primary goal is to sequentially animate two types of renderable series—a bubble series and a spline line series—by applying four distinct animations: Wave, Sweep, Scale, and Fade. A custom typewriter effect is also created for a watermark annotation to display the current animation effect. This example showcases interactive chart modifiers for zooming and panning, ensuring a smooth and engaging user experience.

Technical Implementation

The chart is initialized by creating a SciChartSurface with numeric axes through an asynchronous function, utilizing the async/await pattern for proper resource initialization. Data for the chart is generated dynamically and fed into two renderable series using the standard SciChart.js data series objects. Animations are managed by enqueuing them on the renderable series and are cycled continuously via a looping mechanism implemented with setTimeout. A custom animation, based on the GenericAnimation class, is used to create a typewriter text effect. Developers looking to understand the fundamentals of startup animations in this framework may refer to the JavaScript Startup Animation - SciChart documentation for detailed guidance.

Features and Capabilities

The example highlights several advanced features of SciChart.js such as real-time animation chaining and dynamic data binding. By sequentially applying different series animations, the visual entrance effects become more engaging. Interactive chart modifiers like ZoomPanModifier, ZoomExtentsModifier, and MouseWheelZoomModifier are incorporated to provide enhanced user interactivity. Performance is further optimized by leveraging the underlying WebAssembly contexts, as detailed in the Performance Tips & Tricks documentation.

Integration and Best Practices

Although parts of the example are integrated into a React component for demonstration purposes, the JavaScript implementation in the provided files is standalone and can be easily embedded into a basic HTML file. The design emphasizes clear separation of concerns through proper lifecycle management, ensuring that the SciChartSurface is appropriately deleted when no longer needed, as highlighted in the Getting Started with SciChart JS guide. Developers are encouraged to follow these best practices for resource cleanup and performance optimization, which are critical for building high-performance web applications. For additional interactive behavior, refer to the Tutorial 03 - Adding Zooming, Panning Behavior that explains how to integrate zoom and pan modifiers effectively.

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