JavaScript Polar Spline Line Chart

Creates a JavaScript Polar Spline Line Chart using SciChart.js, using either a Cubic spline, or polar interpolation

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    PolarNumericAxis,
6    SciChartPolarSurface,
7    EPolarAxisMode,
8    NumberRange,
9    EAxisAlignment,
10    EPolarLabelMode,
11    PolarLegendModifier,
12    PolarLineRenderableSeries,
13    BezierRenderDataTransform,
14    XyDataSeries,
15    SplineRenderDataTransform,
16    WaveAnimation,
17} from "scichart";
18import { appTheme } from "../../../theme";
19
20export const drawExample = async (rootElement: string | HTMLDivElement) => {
21    const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(rootElement, {
22        theme: appTheme.SciChartJsTheme,
23    });
24
25    const radialYAxis = new PolarNumericAxis(wasmContext, {
26        polarAxisMode: EPolarAxisMode.Radial,
27        axisAlignment: EAxisAlignment.Right,
28        visibleRange: new NumberRange(0, 6),
29        drawMinorTickLines: false,
30        drawMajorTickLines: false,
31        useNativeText: true,
32        drawMinorGridLines: false,
33        zoomExtentsToInitialRange: true,
34        labelPrecision: 0,
35        innerRadius: 0.1, // donut hole
36    });
37    sciChartSurface.yAxes.add(radialYAxis);
38
39    const polarXAxis = new PolarNumericAxis(wasmContext, {
40        polarAxisMode: EPolarAxisMode.Angular,
41        axisAlignment: EAxisAlignment.Top,
42
43        polarLabelMode: EPolarLabelMode.Parallel,
44
45        autoTicks: false,
46        majorDelta: 1,
47
48        useNativeText: true,
49        flippedCoordinates: true, // go clockwise
50        totalAngle: Math.PI,
51        labelPrecision: 0,
52    });
53    sciChartSurface.xAxes.add(polarXAxis);
54
55    const ANIMATION_DURATION = 500;
56    const xValues = [0, 1, 2, 3, 4, 5, 6, 7, 8];
57    const yValues = [3, 4, 2, 4, 5, 5, 3, 2, 4];
58
59    // 1. regular polar line
60    const regularPolarLine = new PolarLineRenderableSeries(wasmContext, {
61        dataSeries: new XyDataSeries(wasmContext, {
62            xValues,
63            yValues,
64            dataSeriesName: "Original Data",
65        }),
66        stroke: "white",
67        strokeThickness: 3,
68    });
69
70    // 2. cubic polar line
71    const cubicPolarLine = new PolarLineRenderableSeries(wasmContext, {
72        dataSeries: new XyDataSeries(wasmContext, {
73            xValues,
74            yValues,
75            dataSeriesName: "Cubic",
76        }),
77        stroke: appTheme.VividOrange,
78        strokeThickness: 5,
79        animation: new WaveAnimation({ duration: ANIMATION_DURATION, delay: ANIMATION_DURATION }),
80    });
81    // Add cubic bezier transform
82    const cubicTransform = new SplineRenderDataTransform(cubicPolarLine, wasmContext, [
83        cubicPolarLine.drawingProviders[0],
84    ]);
85    cubicTransform.interpolationPoints = 30;
86    cubicPolarLine.renderDataTransform = cubicTransform;
87
88    // 3. interpolated polar line
89    const interpolatedPolarLine = new PolarLineRenderableSeries(wasmContext, {
90        dataSeries: new XyDataSeries(wasmContext, {
91            xValues,
92            yValues,
93            dataSeriesName: "Interpolated",
94        }),
95        interpolateLine: true, //
96        stroke: appTheme.VividPurple,
97        strokeThickness: 5,
98        animation: new WaveAnimation({ duration: ANIMATION_DURATION, delay: 2 * ANIMATION_DURATION }),
99    });
100
101    sciChartSurface.renderableSeries.add(regularPolarLine, cubicPolarLine, interpolatedPolarLine);
102
103    sciChartSurface.chartModifiers.add(
104        new PolarPanModifier(),
105        new PolarZoomExtentsModifier(),
106        new PolarMouseWheelZoomModifier(),
107        new PolarLegendModifier({
108            showCheckboxes: true,
109        })
110    );
111
112    return { sciChartSurface, wasmContext };
113};
114

Polar Spline Line Chart – JavaScript

Overview

This example demonstrates rendering multiple polar spline and interpolated line series using SciChart.js in Vanilla JavaScript. It initializes SciChartPolarSurface, configures radial and angular PolarNumericAxis, and visualizes original, cubic-spline, and interpolated lines.

Technical Implementation

The chart is created asynchronously via SciChartPolarSurface.create(). Two PolarNumericAxis instances define the radial (0–6) and angular (0–π) axes. Three PolarLineRenderableSeries are configured with XyDataSeries, each using WebGL for optimal performance. Cubic smoothing is applied through SplineRenderDataTransform (API Docs), while setting interpolateLine: true causes line segments to draw as arcs as it is linearly interpolating the polar values between points (API Docs).

Features and Capabilities

Real-time animations use WaveAnimation with staggered delays. Users can pan, zoom, and reset axes via PolarPanModifier, PolarMouseWheelZoomModifier, and PolarZoomExtentsModifier. A legend with checkboxes (PolarLegendModifier) toggles series visibility.

Integration and Best Practices

Disposal is handled by deleting the sciChartSurface when done. Axis options like flippedCoordinates and innerRadius showcase customizable polar layouts. Data transforms run on the GPU for smooth curves without blocking the UI.

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 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 Area Chart | Polar Mountain Chart | SciChart

JavaScript Polar Area Chart | Polar Mountain Chart

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

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.