JavaScript Stacked Radial Column Chart | Stacked Radial Bar Chart

Creates a JavaScript Stacked Radial Column Chart representing Olympic medals per country, using SciChart.js

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    EXyDirection,
12    PolarCategoryAxis,
13    TextLabelProvider,
14    PolarStackedColumnCollection,
15    PolarStackedColumnRenderableSeries,
16    EPolarLabelMode,
17    PolarLegendModifier,
18    ELegendPlacement,
19    GradientParams,
20    Point,
21    WaveAnimation
22} from "scichart";
23import { appTheme } from "../../../theme";
24
25const DATA: Record<string, number[]> = {
26    "Norway": [122, 125, 111],
27    "USA": [105, 110, 88],
28    "Germany": [92, 88, 60],
29    "Canada": [73, 64, 62],
30    "Austria": [64, 81, 87],
31    "Sweden": [57, 46, 55],
32    "Switzerland": [56, 45, 52],
33    "Russia": [47, 38, 35],
34    "Netherlands": [45, 44, 41],
35    "Finland": [43, 55, 59]
36}
37const COUNTRIES = Object.keys(DATA);
38
39const MEDALS = [
40    {
41        type: "Gold",
42        color: appTheme.MutedOrange,
43    },
44    {
45        type: "Silver",
46        color: appTheme.PaleBlue,
47    },
48    {
49        type: "Bronze",
50        color: appTheme.MutedRed,
51    }
52];
53
54export const drawExample = async (rootElement: string | HTMLDivElement) => {
55    const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(rootElement, {
56        theme: appTheme.SciChartJsTheme,
57        title: "Winter Olympic medals per country",
58        titleStyle: {
59            fontSize: 24,
60        }
61    });
62
63    // Create Polar, Radial axes
64    const xAxis = new PolarCategoryAxis(wasmContext, {
65        polarAxisMode: EPolarAxisMode.Radial,
66        axisAlignment: EAxisAlignment.Left,
67        visibleRange: new NumberRange(-1, 9),
68        zoomExtentsToInitialRange: true,
69
70        autoTicks: false,
71        majorDelta: 1,
72
73        useNativeText: true,
74        flippedCoordinates: true, // Norway will be outermost, Finland innermost
75        innerRadius: 0.1, // donut hole
76        drawMinorTickLines: false,
77        drawMinorGridLines: false,
78        drawMajorTickLines: false,
79        startAngle: Math.PI,
80    });
81    xAxis.labelProvider = new TextLabelProvider({
82        labels: Object.keys(DATA),
83    });
84    sciChartSurface.xAxes.add(xAxis);
85
86    const yAxis = new PolarNumericAxis(wasmContext, {
87        polarAxisMode: EPolarAxisMode.Angular,
88        axisAlignment: EAxisAlignment.Top,
89        polarLabelMode: EPolarLabelMode.Parallel,
90        drawMinorTickLines: false,
91        drawMinorGridLines: false,
92        drawMajorTickLines: false,
93        flippedCoordinates: true,
94        labelPrecision: 0,
95        useNativeText: true,
96        autoTicks: false,
97        majorDelta: 25,
98        startAngle: Math.PI,
99        totalAngle: Math.PI * 3 / 2 // 270 degrees, 3/4 of the circle
100    });
101    sciChartSurface.yAxes.add(yAxis);
102
103    // SERIES
104    const collection = new PolarStackedColumnCollection(wasmContext);
105    collection.animation = new WaveAnimation({ duration: 1000, fadeEffect: true });
106    
107    const xValues = Array.from({ length: COUNTRIES.length }, (_, i) => i);
108    for(let i = 0; i < 3; i++){
109        const polarColumn = new PolarStackedColumnRenderableSeries(wasmContext, {
110            dataSeries: new XyDataSeries(wasmContext, {
111                xValues,
112                yValues: COUNTRIES.map(country => DATA[country][i]),
113                dataSeriesName: MEDALS[i].type,
114            }),
115            // stroke: "white",
116            strokeThickness: 1.5,
117            fill: MEDALS[i].color, // keep the "fill" although overriden by "fillLinearGradient" for legend marker color
118            fillLinearGradient: new GradientParams(new Point(0, 0), new Point(0, 1), [
119                { color: MEDALS[i].color, offset: 0.5 },
120                { color: "#222222", offset: 1 },
121            ]),
122        });
123        collection.add(polarColumn);
124    }
125
126    sciChartSurface.renderableSeries.add(collection);
127
128    // MODIFIERS
129    sciChartSurface.chartModifiers.add(
130        new PolarPanModifier({
131            xyDirection: EXyDirection.XyDirection,
132            zoomSize: true,
133            growFactor: 1
134        }),
135        new PolarZoomExtentsModifier(),
136        new PolarMouseWheelZoomModifier(),
137        new PolarLegendModifier({
138            placement: ELegendPlacement.TopLeft,
139            backgroundColor: "rgba(0,0,0,0.3)",
140            showCheckboxes: true,
141        })
142    );
143
144    return { sciChartSurface, wasmContext };
145};

Polar Stacked Radial Column Chart - JavaScript

Overview

This example demonstrates how to create a Polar Stacked Radial Column Chart using SciChart.js, visualizing Winter Olympic medals per country with stacked columns in a polar coordinate system. The chart uses PolarStackedColumnCollection to display medal counts as radial columns.

Technical Implementation

The chart initializes a SciChartPolarSurface with radial (x) and angular (y) axes. The x-axis is configured with EPolarAxisMode.Radial and uses a TextLabelProvider for country names. Three PolarStackedColumnRenderableSeries represent gold, silver, and bronze medals with gradient fills.

Features and Capabilities

The example includes interactive modifiers like PolarZoomExtentsModifier and PolarLegendModifier for user interaction. The WaveAnimation provides smooth series initialization.

Integration and Best Practices

The implementation follows async initialization patterns and includes proper cleanup. The radial layout with flippedCoordinates ensures optimal data presentation.

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