For Digital Mountain Charts, you can use this demonstration to see how to create a React Digital Mountain Chart using SciChart.js, and its powerful JavaScript Chart Library.
import {
FastMountainRenderableSeries,
GradientParams,
MouseWheelZoomModifier,
NumberRange,
NumericAxis,
Point,
RubberBandXyZoomModifier,
SciChartSurface,
WaveAnimation,
XyDataSeries,
ZoomExtentsModifier,
} from "scichart";
import { appTheme } from "./appTheme";
import { RandomWalkGenerator } from "./RandomWalkGenerator";
export const drawExample = async (rootElement: string | HTMLDivElement) => {
// Create a SciChartSurface
const { wasmContext, sciChartSurface } = await SciChartSurface.create(rootElement, {
theme: appTheme.SciChartJsTheme,
});
// Create an XAxis and YAxis
sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { axisTitle: "X Axis" }));
sciChartSurface.yAxes.add(
new NumericAxis(wasmContext, {
growBy: new NumberRange(0.05, 0.05),
axisTitle: "Y Axis",
})
);
const POINTS = 200;
// Create arrays of x, y values
const xValues = Array.from(Array(POINTS).keys());
const yValues = new RandomWalkGenerator().Seed(0).getRandomWalkSeries(POINTS).yValues;
// Create a Mountain Series and add to the chart
const mountainSeries = new FastMountainRenderableSeries(wasmContext, {
dataSeries: new XyDataSeries(wasmContext, { xValues, yValues }),
stroke: appTheme.VividOrange,
strokeThickness: 3,
zeroLineY: 0.0,
fill: appTheme.VividOrange, // when a solid color is required, use fill
// when a gradient is required, use fillLinearGradient
fillLinearGradient: new GradientParams(new Point(0, 0), new Point(0, 1), [
{ color: appTheme.MutedOrange, offset: 0 },
{ color: "Transparent", offset: 1 },
]),
isDigitalLine: true,
animation: new WaveAnimation({ duration: 1000, fadeEffect: true, zeroLine: 0 }),
});
sciChartSurface.renderableSeries.add(mountainSeries);
// Optional: Add some interactivity to the chart
sciChartSurface.chartModifiers.add(new ZoomExtentsModifier());
sciChartSurface.chartModifiers.add(new RubberBandXyZoomModifier());
sciChartSurface.chartModifiers.add(new MouseWheelZoomModifier());
sciChartSurface.zoomExtents();
return { wasmContext, sciChartSurface };
};
This example demonstrates how to create a React Digital Mountain Chart using SciChart.js. The chart renders a digital mountain series with a stepped-line visual effect, enhanced by wave animation and a linear gradient fill. Data is generated via a random walk, simulating realistic trends in a high-performance WebGL environment.
The chart is integrated into a React application using the SciChartReact component, which initializes the chart through a prop-based method. Within the initialization function, a SciChartSurface is created and configured with NumericAxis for both X and Y dimensions. A FastMountainRenderableSeries is constructed with digital line rendering and a gradient defined via GradientParams. Additional technical details can be found in the Digital Mountain Series Documentation.
The example incorporates advanced features such as a WaveAnimation effect with fade to deliver a compelling visual presentation. Interactive modifiers including ZoomExtentsModifier, RubberBandXyZoomModifier, and MouseWheelZoomModifier are added to enable intuitive data exploration. These features are optimized for performance, which is essential for handling real-time data updates, as discussed in the Performance Optimisation of JavaScript Applications & Charts.
React integration is accomplished via a prop-based chart initialization pattern that ensures a clean and reusable component design, as highlighted in Creating a SciChart React Component from the Ground Up. Best practices are observed by leveraging WebGL rendering for high fidelity performance and incorporating interactive chart modifiers for enhanced usability. This approach mirrors advanced implementations like those in the React Mountain Chart example, providing a robust foundation for building interactive data visualizations in React.








































