JavaScript Surface Mesh 3D Chart

Learn how to create a detailed 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 ... 

Surface Mesh 3D Chart - JavaScript

Overview

This example demonstrates how to create a 3D surface mesh chart using SciChart.js in JavaScript. The example constructs a heightmap using a 2D array and renders it with a dynamic color gradient, providing an interactive 3D visualization. Developers can learn how to efficiently set up a 3D chart project as explained in the 3D Tutorial 01.

Technical Implementation

The implementation begins with the creation of a SciChart3DSurface in plain JavaScript, leveraging the high-performance WebAssembly context (wasmContext) for rendering. The camera is precisely positioned using the CameraController and Vector3 classes, as documented in The SciChartSurface Camera. Next, the world dimensions and three numeric axes are defined with NumericAxis3D, which is further detailed in the Numeric Axis in SciChart3D guide. A uniform grid heightmap is then generated using the helper function zeroArray2D and populated with sine wave calculations. This data is subsequently wrapped in a UniformGridDataSeries3D to feed into the renderable series. For color mapping, the example employs a GradientColorPalette to create custom gradient fills, which you can read more about in the GradientColorPalette documentation. Finally, the surface mesh is rendered as a solid wireframe using SurfaceMeshRenderableSeries3D.

Features and Capabilities

The example integrates several advanced features including interactive chart modifiers such as MouseWheelZoomModifier3D, OrbitModifier3D, ResetCamera3DModifier, and TooltipModifier3D. These modifiers offer an intuitive user experience for exploring the 3D visualization. For additional details on interactivity, refer to the Tooltip Modifier 3D documentation. The use of WebAssembly (wasmContext) and WebGL-based rendering ensures high performance even with complex 3D datasets, following best practices as described in the Getting Started with SciChart JS guide.

Integration and Best Practices

This example emphasizes a clean integration approach by using JavaScript without reliance on frameworks like React or Angular. It showcases how to directly manipulate the SciChart3DSurface and its components to achieve desired visual effects. Additionally, developers are encouraged to explore performance optimization techniques through efficient WebGL rendering and proper use of the wasmContext, as outlined in the SciChart JS User Manual. By following these practices, one can build highly responsive and visually rich 3D charts.

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