JavaScript Polar Area Chart | Polar Mountain Chart

Creates a JavaScript Polar Mountain Chart, also known as a Polar Area Chart using SciChart.js, with both regular & interpolated mountain modes, via PolarMountainRenderableSeries

Fullscreen

Edit

 Edit

Docs

drawExample.ts

index.html

vanilla.ts

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    GradientParams, 
12    Point, 
13    EPolarLabelMode,
14    WaveAnimation,
15    PolarMountainRenderableSeries,
16    PolarLegendModifier
17} from "scichart";
18import { appTheme } from "../../../theme";
19
20const xValues = [0, 1, 2, 3, 4, 5, 6, 7, 8];
21const MountainsDatasets = [
22    {
23        yValues: [2.6, 5.6, 3, 5, 4.8, 1.8, 5, 4.5, 3.5],
24        fillColor: appTheme.VividOrange,
25        interpolateLine: true,
26    },
27    {
28        yValues: [4.2, 2.5, 3.9, 2.5, 4, 5.5, 2.5, 4, 3],
29        fillColor: appTheme.VividTeal,
30        interpolateLine: false,
31    },
32    {
33        yValues: [1.3, 3.3, 2.5, 4.5, 5.5, 3, 4.5, 4.9, 2.4],
34        fillColor: appTheme.VividPink,
35        interpolateLine: false,
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    const radialYAxis = new PolarNumericAxis(wasmContext, {
45        polarAxisMode: EPolarAxisMode.Radial,
46        axisAlignment: EAxisAlignment.Right,
47        visibleRange: new NumberRange(0, 6),
48        drawMinorTickLines: false,
49        drawMajorTickLines: false,
50        useNativeText: true,
51        drawMinorGridLines: false,
52        startAngle: Math.PI / 2,
53        zoomExtentsToInitialRange: true,
54        labelPrecision: 0,
55        labelStyle: {
56            color: "white",
57        },
58    });
59    sciChartSurface.yAxes.add(radialYAxis);
60
61    const polarXAxis = new PolarNumericAxis(wasmContext, {
62        polarAxisMode: EPolarAxisMode.Angular,
63        axisAlignment: EAxisAlignment.Top,
64        polarLabelMode: EPolarLabelMode.Parallel,
65        visibleRange: new NumberRange(0, 9),
66        flippedCoordinates: true, // go clockwise
67        useNativeText: true,
68        startAngle: Math.PI / 2, // start at 12 o'clock
69        zoomExtentsToInitialRange: true,
70        labelPrecision: 0,
71        labelStyle: {
72            color: "white",
73        },
74    });
75    sciChartSurface.xAxes.add(polarXAxis);
76
77    MountainsDatasets.forEach(({yValues, fillColor, interpolateLine}) => {
78        const polarMountain = new PolarMountainRenderableSeries(wasmContext, {
79            dataSeries: new XyDataSeries(wasmContext, {
80                xValues: [...xValues, xValues[xValues.length - 1] + 1], // add 1 more xValue to close the loop
81                yValues: [...yValues, yValues[0]], // close the loop by drawing to the first yValue
82                dataSeriesName: interpolateLine ? "Interpolated" : "Straight",
83            }),
84            fillLinearGradient: new GradientParams(
85                new Point(0, 0), 
86                new Point(0, 1), 
87                [
88                    { color: fillColor + "AA", offset: 0 },
89                    { color: fillColor + "33", offset: 0.3 },
90                ]
91            ),
92            interpolateLine: interpolateLine,
93            stroke: fillColor, // this also gives off the color for the legend marker
94            strokeThickness: 2,
95            animation: new WaveAnimation({ duration: 800, zeroLine: 0 }),
96        });
97        sciChartSurface.renderableSeries.add(polarMountain);
98    })
99
100    sciChartSurface.chartModifiers.add(
101        new PolarPanModifier(),
102        new PolarZoomExtentsModifier(),
103        new PolarMouseWheelZoomModifier(),
104        new PolarLegendModifier({
105            showCheckboxes: true,
106        })
107    );
108
109    return { sciChartSurface, wasmContext };
110};

Polar Mountain / Area Chart - JavaScript

Overview

This example demonstrates how to create a Polar Mountain / Area Chart using SciChart.js in vanilla JavaScript. The implementation showcases three mountain series in polar coordinates with gradient fills and optional line interpolation, using the PolarMountainRenderableSeries for radial data visualization.

Technical Implementation

The chart is initialized asynchronously using SciChartPolarSurface.create() with a custom theme. It features a radial Y-axis configured with PolarNumericAxis in EPolarAxisMode.Radial mode and an angular X-axis in EPolarAxisMode.Angular mode. Each mountain series uses an XyDataSeries with closed-loop data points and applies a gradient fill via GradientParams.

Features and Capabilities

The example highlights polar chart capabilities including: clockwise coordinate system, parallel axis labels, and interactive modifiers like PolarZoomExtentsModifier and PolarLegendModifier. The interpolateLine property demonstrates both straight and curved line rendering options.

Integration and Best Practices

The implementation follows best practices for asynchronous initialization and resource cleanup. Developers can extend this example by adding real-time updates or customizing the polar axes as described in the Polar Charts documentation.

javascript Chart Examples & Demos

See Also: Polar Charts (21 Demos)

JavaScript Polar Line Chart | Javascript Charts | SciChart.js

JavaScript 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.

JavaScript Polar Spline Line Chart | SciChart.js Demo

JavaScript Polar Spline Line Chart

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

JavaScript Multi-Cycle Polar Line | SciChart.js Demo

JavaScript Multi Cycle-Polar Line Example

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

JavaScript Polar Column Chart | Polar Bar Chart | SciChart

JavaScript Polar Column | Polar Bar

Try the JavaScript Polar Column or Bar Chart example to render bars in a polar layout with gradient fills and animations. Use SciChart for seamless integrations.

JavaScript Polar Column Category Chart | SciChart.js Demo

JavaScript Polar Column Category Chart

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

JavaScript Polar Range Column Chart | SciChart.js Demo

JavaScript Polar Range Column Chart

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

JavaScript Windrose Plot | Polar Stacked Radial Column Chart

JavaScript Windrose Plot | Polar Stacked Radial Column Chart

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

JavaScript Polar Sunburst Chart | Javascript Charts | SciChart.js

JavaScript Polar Sunburst Chart

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

JavaScript Polar Radial Column Chart | SciChart.js Demo

JavaScript Polar Radial Column Chart

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

JavaScript Stacked Radial Column Chart | Stacked Radial Bar Chart

JavaScript Stacked Radial Column Chart | Stacked Radial Bar Chart

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

JavaScript Polar Stacked Radial Mountain Chart | SciChart

JavaScript Polar Stacked Radial Mountain Chart

Try the JavaScript Stacked Radial Mountain Chart example to show multiple datasets on a polar layout with a stacked mountain series and animated transitions.

JavaScript Polar Band | Polar Error Bands Chart | SciChart

JavaScript Polar Band | Polar Error Bands Chart

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

JavaScript Polar Scatter Chart | Javascript Charts | SciChart.js

JavaScript Polar Scatter Chart

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

JavaScript Polar Radar Chart | Spider Radar Chart | SciChart

JavaScript Polar Radar Chart

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

JavaScript Polar Gauge Chart | Circular Gauge Chart

JavaScript Gauge Charts

Create JavaScript Gauge Charts, including a JavaScript Circular Gauge Dashboard, with user-friendly initialization and responsive design. Give SciChart a go.

JavaScript Arc Gauge & FIFO Scrolling Charts Dashboard

JavaScript Arc Gauge & FIFO Scrolling Charts Dashboard Example

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

JavaScript Polar Uniform Heatmap Chart | SciChart.js Demo

JavaScript Polar Uniform Heatmap Chart

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

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

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

No description available for this example yet

JavaScript Polar Partial Arc | Javascript Charts | SciChart.js

JavaScript Polar Partial Arc

Create a JavaScript 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.

JavaScript Polar Axis Label Modes | SciChart.js Demo

JavaScript Polar Axis Label Modes

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

JavaScript Polar Map Example | Javascript Charts | SciChart.js

JavaScript 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.