React Polar Stacked Radial Mountain Chart

Creates a React Polar Stacked Mountain Chart using SciChart's powerful JavaScript Charts and its range of features.

Fullscreen

Edit

 Edit

Docs

drawExample.ts

index.tsx

theme.ts

Copy to clipboard
Minimise
Fullscreen
1import {
2    PolarMouseWheelZoomModifier,
3    PolarZoomExtentsModifier,
4    PolarPanModifier,
5    XyDataSeries,
6    PolarNumericAxis,
7    SciChartPolarSurface,
8    EPolarAxisMode, 
9    NumberRange, 
10    EAxisAlignment,  
11    EPolarLabelMode,
12    WaveAnimation,
13    PolarStackedMountainCollection,
14    PolarStackedMountainRenderableSeries,
15    PolarLegendModifier,
16} from "scichart";
17import { appTheme } from "../../../theme";
18
19const xValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
20const MountainsDatasets = [
21    {
22        yValues: [2.7, 1.4, 2.3, 2.1, 1.2, 1.5, 2.4, 1.5, 2.7, 1.3],
23        fillColor: appTheme.DarkIndigo,
24    },
25    {
26        yValues: [3.2, 0.9, 2, 2.5, 1.3, 2.8, 2.1, 2, 1.2, 2.4],
27        fillColor: appTheme.VividBlue,
28    },
29    {
30        yValues: [0.3, 2.3, 1.7, 3.2, 2, 2.9, 1, 2, 2.1, 1.1],
31        fillColor: appTheme.VividOrange,
32    },
33    {
34        yValues: [2.1, 1.8, 2.7, 0.5, 2.2, 0.3, 3, 1.6, 2.1, 1],
35        fillColor: appTheme.VividPink,
36    },
37];
38
39export const drawExample = async (rootElement: string | HTMLDivElement) => {
40    const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(rootElement, {
41        theme: appTheme.SciChartJsTheme,
42    });
43
44    // add Radial Y axis
45    const radialYAxis = new PolarNumericAxis(wasmContext, {
46        polarAxisMode: EPolarAxisMode.Radial,
47        axisAlignment: EAxisAlignment.Right,
48
49        visibleRange: new NumberRange(0, 9),
50        drawMinorTickLines: false,
51        drawMajorTickLines: false,
52        useNativeText: true,
53        drawMinorGridLines: false,
54
55        startAngle: Math.PI / 2,
56        zoomExtentsToInitialRange: true,
57        labelPrecision: 0,
58        labelStyle: {
59            color: "white",
60        },
61    });
62    sciChartSurface.yAxes.add(radialYAxis);
63
64    // add Angular X axis
65    const polarXAxis = new PolarNumericAxis(wasmContext, {
66        polarAxisMode: EPolarAxisMode.Angular,
67        axisAlignment: EAxisAlignment.Top,
68
69        visibleRange: new NumberRange(0, 10),
70        polarLabelMode: EPolarLabelMode.Parallel,
71        
72        startAngle: Math.PI / 2, // start at 12 o'clock
73        flippedCoordinates: true, // go clockwise
74        zoomExtentsToInitialRange: true,
75        
76        useNativeText: true,
77        labelPrecision: 0,
78        labelStyle: {
79            color: "white",
80        },
81    });
82    sciChartSurface.xAxes.add(polarXAxis);
83
84    // Make collection to hold all the stacked mountains renderable series
85    const mountainCollection = new PolarStackedMountainCollection(wasmContext);
86    mountainCollection.separatePositiveNegativeStacks = false;
87    mountainCollection.animation = new WaveAnimation({ duration: 800, zeroLine: 0 }),
88
89    MountainsDatasets.forEach(({yValues, fillColor}) => {
90        const polarMountain = new PolarStackedMountainRenderableSeries(wasmContext, {
91            dataSeries: new XyDataSeries(wasmContext, {
92                xValues: [...xValues, xValues[xValues.length - 1] + 1], // add 1 more xValue to close the loop
93                yValues: [...yValues, yValues[0]] // close the loop by drawing to the first yValue
94            }),
95            fill: fillColor + "BB", // 75% opacity
96            stroke: "white",
97            strokeThickness: 1,
98        });
99        mountainCollection.add(polarMountain);
100    })
101    sciChartSurface.renderableSeries.add(mountainCollection);
102
103    sciChartSurface.chartModifiers.add(
104        new PolarPanModifier(),
105        new PolarZoomExtentsModifier(),
106        new PolarMouseWheelZoomModifier(),
107        new PolarLegendModifier({
108            showCheckboxes: true,
109            backgroundColor: "#88888833",
110        })
111    );
112
113    return { sciChartSurface, wasmContext };
114};

Polar Stacked Mountain Chart – React

Overview

This example demonstrates how to integrate a Polar Stacked Mountain Chart within a React application using the `` component. It visualizes multiple datasets on a polar coordinate system with stacked mountain series and animated transitions.

Technical Implementation

The initChart function passed to `` uses SciChartPolarSurface.create() to initialize the chart surface and WebAssembly context. Two polar axes (PolarNumericAxis) are added—one radial, one angular—configured for clockwise angular layout, precision labeling, and custom styling. A PolarStackedMountainCollection aggregates individual PolarStackedMountainRenderableSeries, each driven by XyDataSeries to close the loop. A WaveAnimation smoothly renders the collection. Chart interaction is provided by PolarPanModifier, PolarMouseWheelZoomModifier, PolarZoomExtentsModifier, and a PolarLegendModifier for toggling series visibility within the legend panel.

Features and Capabilities

The chart supports dynamic data streaming by updating the XyDataSeries of each mountain series. Customizable fill opacity and stroke thickness enable clear differentiation between stacked layers. The legend’s checkboxes allow end users to show or hide individual series in real time.

Integration and Best Practices

Utilize the `` component to manage chart lifecycle and cleanup automatically. Define theming through appTheme for consistent look and feel. For detailed API reference, consult the Polar Stacked Mountain Series guide.

react Chart Examples & Demos

See Also: Polar Charts (21 Demos)

React Polar Line Chart | React Charts | SciChart.js Demo

React Polar Line Chart

Explore the React Polar Line Chart example to create data labels, line interpolation, gradient palette stroke and startup animations. Try the SciChart Demo.

React Polar Spline Line Chart | React Charts | SciChart.js

React Polar Spline Line Chart

Try the React Polar Spline Line Chart example to see SciChart's GPU-accelerated rendering in action. Choose a cubic spline or polar interpolation. View demo.

React Multi-Cycle Polar Line | React Charts | SciChart.js

React Multi Cycle-Polar Line Example

Create a React Multi-Cycle Polar Chart to plot data over multiple cycles and visualize patterns over time. This example shows surface temperature by month.

React Polar Column Chart | React Polar Bar Chart | SciChart

React Polar Column | React Polar Bar

Try the React Polar Bar Chart example to render bars in a polar layout with gradient fills and animations. Use SciChart for seamless integration with React.

React Polar Column Category Chart | SciChart.js Demo

React Polar Column Category Chart

Create a React Polar Colum Category chart visualizing UK consumer price changes. Try the demo with a custom positive/negative threshold fill and stroke.

React Polar Range Column Chart | React Charts | SciChart.js

React Polar Range Column Chart

Create a React Polar Range Column Chart with SciChart. This example displays monthly minimum and maximum temperatures within a Polar layout. Try the demo.

React Windrose Plot | React Polar Stacked Radial Column Chart

React Windrose Plot | React Polar Stacked Radial Column Chart

View the React Windrose Chart example to display directional data with stacked columns in a polar layout. Try the polar chart demo with customizable labels.

React Polar Sunburst Chart | React Charts | SciChart.js

React Polar Sunburst Chart

See the React Sunburst Chart example with multiple levels, smooth animation transitions and dynamically updating segment colors. Try the SciChart demo.

React Polar Radial Column Chart | React Charts | SciChart.js

React Polar Radial Column Chart

View the React Radial Column Chart example to see the difference that SciChart has to offer. Switch radial and angular axes and add interactive modifiers.

React Stacked Radial Column Chart | Stacked Radial Bar Chart

React Stacked Radial Column Chart | Stacked Radial Bar Chart

This React Stacked Radial Bar Chart example shows Olympic medal data by country. Try the demo for yourself with async initialization and theme application.

React Polar Area Chart | Polar Mountain Chart | SciChart

React Polar Area Chart | Polar Mountain Chart

The React Polar Area Chart example, also known as Nightingale Rose Chart, renders an area series with polar coordinates with interactive legend controls.

React Polar Band | Polar Error Bands Chart | SciChart.js

React Polar Band | Polar Error Bands Chart

Create a React Polar Chart with regular and interpolated error bands. Enhance a standard chart with shaded areas to show upper and lower data boundaries.

React Polar Scatter Chart | React Charts | SciChart.js Demo

React Polar Scatter Chart

Build a React Polar Scatter Chart with this example to render multiple scatter series on radial and angular axes. Try the flexible SciChart demo today.

React Polar Radar Chart | Spider Radar Chart | SciChart

React Polar Radar Chart

View the React Polar Radar Chart example. Also known as the Spider Radar Chart, view the scalability and stability that SciChart has to offer. Try demo.

React Polar Gauge Chart | React Circular Gauge | SciChart

React Gauge Charts

Create React Gauge Charts, including a React Circular Gauge Dashboard, with React-friendly initialization and responsive design. Give the SciChart demo a go.

React Arc Gauge & FIFO Scrolling Charts Dashboard | SciChart

React Arc Gauge & FIFO Scrolling Charts Dashboard Example

View React Arc Gauge Charts alongside FIFO Scrolling Charts, all on the same dashboard with real-time, high-performance data rendering. Try the demo.

React Polar Uniform Heatmap Chart | SciChart.js Demo

React Polar Uniform Heatmap Chart

Try SciChart's React Polar Heatmap example to combine a polar heatmap with a legend component. Supports responsive design and chart and legend separation.

React Polar Heatmap | B-Mode Image Ultrasound | Medical Heatmap

React Polar Heatmap | B-Mode Image Ultrasound | Medical Heatmap

No description available for this example yet

React Polar Partial Arc | React Charts | SciChart.js Demo

React Polar Partial Arc

Create a React Polar Partial Arc that bends from a full Polar Circle to a Cartesian-like arc. Try the demo to display an arc segment with Polar coordinates.

React Polar Axis Label Modes | React Charts | SciChart.js

React Polar Axis Label Modes

Create a React Polar Axis Label with SciChart. This demo shows the various label modes for Polar Axes – all optimised for pan, zoom, and mouse wheel.

React Polar Map Example | React Charts | SciChart.js Demo

React Polar Map Example

View the React Polar Map Example using the SciChartReact component. Display geographic data as color-coded triangles on a polar coordinate system. Try demo.

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