JavaScript Realtime Surface Mesh 3D Chart

Learn how to create a realtime updating JavaScript 3D Surface Mesh Chart using SciChart.js, and our High Performance JavaScript 3D Chart Library

Fullscreen

Edit

 Edit

Docs

drawExample.ts

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

Realtime Surface Mesh 3D Chart (JavaScript)

Overview

This example demonstrates how to build a real-time 3D surface mesh chart using SciChart.js in a JavaScript environment. The chart dynamically updates its mesh data by recalculating a heightmap at regular intervals, providing a fluid, animated visualization of mathematical functions.

Technical Implementation

The chart is constructed by creating a SciChart3DSurface and configuring a 3D camera with the CameraController and Vector3 to set its position and target. Three numeric axes (X, Y, and Z) are added using NumericAxis3D, and the data is managed through a UniformGridDataSeries3D that is initialized with a helper function (zeroArray2D). The data is updated in real time using the native JavaScript function setInterval, as described in the Realtime Updates documentation.

Features and Capabilities

The example includes several advanced features:

  • Real-Time Updates: The heightmap is recalculated every 20 milliseconds, showcasing dynamic data streaming.
  • 3D Surface Mesh Rendering: The surface is rendered using a custom gradient color palette defined with GradientColorPalette, supporting smooth color transitions and contour effects; more details can be found in the Surface Mesh 3D Chart Type guide.
  • Chart Interactivity: Interactivity modifiers such as MouseWheelZoomModifier3D, OrbitModifier3D, and ResetCamera3DModifier let users effortlessly explore the 3D environment.

Integration and Best Practices

This implementation leverages JavaScript, ensuring that the chart library can be integrated into any standard web project without framework-specific overhead. Developers should consider performance optimization techniques to handle rapid real-time updates efficiently. Additionally, using WebAssembly (via the wasmContext) further boosts performance as discussed in the WebAssembly Integration documentation.

By focusing solely on JavaScript, this example highlights the core capabilities of SciChart.js for creating highly interactive, real-time 3D visualizations with minimal overhead.

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