React Polar Radial Column Chart

Creates a React Radial Column Chart using SciChart.js, by switching radial and angular axes, thus creating a Vertical / Radial Chart.

Fullscreen

Edit

 Edit

Docs

drawExample.ts

index.tsx

theme.ts

Copy to clipboard
Minimise
Fullscreen
1import {
2    PolarMouseWheelZoomModifier,
3    PolarZoomExtentsModifier,
4    XyDataSeries,
5    PolarNumericAxis,
6    SciChartPolarSurface,
7    EPolarAxisMode,
8    NumberRange,
9    EAxisAlignment,
10    EPolarLabelMode,
11    PolarColumnRenderableSeries,
12    EStrokePaletteMode,
13    parseColorToUIntArgb,
14    DefaultPaletteProvider,
15    Thickness,
16    EColumnDataLabelPosition,
17    WaveAnimation,
18    PolarArcZoomModifier,
19} from "scichart";
20import { appTheme } from "../../../theme";
21
22class ColumnPaletteProvider extends DefaultPaletteProvider {
23    private readonly strokePalette: number[];
24    private readonly fillPalette: number[];
25
26    constructor() {
27        super();
28        this.strokePaletteMode = EStrokePaletteMode.SOLID;
29
30        this.strokePalette = [
31            parseColorToUIntArgb(appTheme.VividPink),
32            parseColorToUIntArgb(appTheme.MutedRed),
33            parseColorToUIntArgb(appTheme.VividOrange),
34            parseColorToUIntArgb(appTheme.VividSkyBlue),
35            parseColorToUIntArgb(appTheme.Indigo),
36        ];
37
38        this.fillPalette = [
39            parseColorToUIntArgb(appTheme.VividPink + "88"),
40            parseColorToUIntArgb(appTheme.MutedRed + "88"),
41            parseColorToUIntArgb(appTheme.VividOrange + "88"),
42            parseColorToUIntArgb(appTheme.VividSkyBlue + "88"),
43            parseColorToUIntArgb(appTheme.Indigo + "88"), // fills have 50% opacity
44        ];
45    }
46
47    private getThresholdIndex(yValue: number): number {
48        // Clamp value between 0 and 99, then divide into 5 equal parts
49        const clamped = Math.max(0, Math.min(99, yValue));
50        return Math.floor(clamped / 20);
51    }
52
53    overrideStrokeArgb(xValue: number, yValue: number, index: number, opacity: number, metadata: any) {
54        const idx = this.getThresholdIndex(yValue);
55        return this.strokePalette[idx];
56    }
57
58    overrideFillArgb(xValue: number, yValue: number, index: number, opacity: number, metadata: any) {
59        const idx = this.getThresholdIndex(yValue);
60        return this.fillPalette[idx];
61    }
62}
63
64export const drawExample = async (rootElement: string | HTMLDivElement) => {
65    const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(rootElement, {
66        theme: appTheme.SciChartJsTheme,
67    });
68
69    const xAxis = new PolarNumericAxis(wasmContext, {
70        polarAxisMode: EPolarAxisMode.Radial,
71        axisAlignment: EAxisAlignment.Left,
72        visibleRange: new NumberRange(0.5, 15),
73        polarLabelMode: EPolarLabelMode.Horizontal,
74
75        flippedCoordinates: true,
76        zoomExtentsToInitialRange: true,
77        autoTicks: false,
78        majorDelta: 1,
79        useNativeText: true,
80        labelStyle: {
81            padding: new Thickness(4, 4, 4, 4),
82        },
83
84        drawMinorTickLines: false,
85        drawMinorGridLines: false,
86        drawMajorGridLines: true,
87        drawMajorTickLines: false,
88        labelPrecision: 0,
89        innerRadius: 0.2, // donut hole
90        startAngle: 0, // start at 9 o'clock (since we are have flipped coorinates and default "0" is at 3 o'clock)
91    });
92    sciChartSurface.xAxes.add(xAxis);
93
94    const yAxis = new PolarNumericAxis(wasmContext, {
95        polarAxisMode: EPolarAxisMode.Angular,
96        axisAlignment: EAxisAlignment.Top,
97        visibleRange: new NumberRange(0, 100),
98        zoomExtentsToInitialRange: true,
99
100        flippedCoordinates: true,
101
102        drawMajorGridLines: true,
103        drawMinorTickLines: false,
104        drawMinorGridLines: false,
105        drawMajorTickLines: false,
106        labelPrecision: 0,
107        useNativeText: true,
108        autoTicks: false,
109        majorDelta: 10,
110
111        totalAngle: Math.PI,
112        startAngle: 0,
113    });
114    sciChartSurface.yAxes.add(yAxis);
115
116    const polarColumn = new PolarColumnRenderableSeries(wasmContext, {
117        dataSeries: new XyDataSeries(wasmContext, {
118            xValues: Array.from({ length: 15 }, (_, i) => i + 1),
119            yValues: [90, 18, 71, 32, 82, 92, 51, 25, 6, 38, 61, 84, 45, 21, 88],
120        }),
121        dataPointWidth: 0.8,
122        paletteProvider: new ColumnPaletteProvider(),
123        dataLabels: {
124            color: "white",
125            style: {
126                fontSize: 12,
127                padding: new Thickness(0, 0, 0, 0),
128            },
129            precision: 0,
130            labelYPositionMode: EColumnDataLabelPosition.Inside,
131            polarLabelMode: EPolarLabelMode.Parallel,
132        },
133        animation: new WaveAnimation({ duration: 1000 }),
134    });
135
136    sciChartSurface.renderableSeries.add(polarColumn);
137
138    // CHART MODIFIERS
139    sciChartSurface.chartModifiers.add(new PolarArcZoomModifier());
140    sciChartSurface.chartModifiers.add(new PolarZoomExtentsModifier());
141    sciChartSurface.chartModifiers.add(new PolarMouseWheelZoomModifier());
142
143    return { sciChartSurface, wasmContext };
144};
145

Polar Radial Column Chart - React

Overview

This React example renders a Polar Radial Column Chart within the <SciChartReact> component. It showcases radial column series with dynamic palette coloring and interactive zoom modifiers in a React application.

Technical Implementation

Chart creation is handled by passing drawExample to SciChartReact’s initChart prop. Inside drawExample, SciChartPolarSurface.create sets up the surface. Axes are configured using PolarNumericAxis with EPolarAxisMode.Radial and EPolarAxisMode.Angular for radial and angular measurements. A PolarColumnRenderableSeries leverages XyDataSeries for data and a ColumnPaletteProvider extends DefaultPaletteProvider to apply conditional coloring.

Features and Capabilities

Interactive behaviors include PolarArcZoomModifier, PolarZoomExtentsModifier, and PolarMouseWheelZoomModifier for arc-based zooming and mouse-wheel control. Animated series entry is enabled via WaveAnimation for enhanced UX.

Integration and Best Practices

Leverage the React wrapper from scichart-react to manage lifecycle and WASM dependencies. Ensure cleanup by calling sciChartSurface.delete() on component unmount. Use hooks or effects to handle asynchronous chart initialization and disposal.

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 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 Stacked Radial Mountain Chart | SciChart.js

React Polar Stacked Radial Mountain Chart

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

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.