React Polar Axis Label Modes

Creates a React Polar Label Modes Chart using SciChart.js, which demonstrates the different label modes we support for Polar Axes.

Fullscreen

Edit

 Edit

Docs

drawExample.ts

index.tsx

theme.ts

Copy to clipboard
Minimise
Fullscreen
1import {
2    SciChartPolarSurface,
3    PolarMouseWheelZoomModifier,
4    PolarZoomExtentsModifier,
5    PolarPanModifier,
6    XyDataSeries,
7    PolarLineRenderableSeries,
8    EllipsePointMarker,
9    PolarNumericAxis, 
10    EPolarAxisMode,
11    NumberRange,
12    EPolarLabelMode,
13} from "scichart";
14import { appTheme } from "../../../theme";
15
16export const drawExample = async (rootElement: string | HTMLDivElement) => {
17    const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(rootElement, {
18        theme: appTheme.SciChartJsTheme,
19    });
20
21    const radialYAxis = new PolarNumericAxis(wasmContext, {
22        polarAxisMode: EPolarAxisMode.Radial,
23
24        drawMinorGridLines: false,
25        drawMajorTickLines: false,
26        drawMinorTickLines: false,
27
28        useNativeText: true,
29        drawLabels: true,
30        innerRadius: 0,
31        labelPrecision: 0,
32    });
33    sciChartSurface.yAxes.add(radialYAxis);
34
35    // Only Angular axes support `polarLabelMode`
36    const angularXAxis = new PolarNumericAxis(wasmContext, {
37        polarAxisMode: EPolarAxisMode.Angular,
38        polarLabelMode: EPolarLabelMode.Horizontal, // this will change based on user input
39        visibleRange: new NumberRange(0, 100),
40        useNativeText: true,
41
42        drawMinorGridLines: false,
43        drawMajorTickLines: false,
44        drawMinorTickLines: false,
45
46        zoomExtentsToInitialRange: true,
47        labelStyle: {
48            color: "white",
49            fontSize: 16
50        },
51    });
52    sciChartSurface.xAxes.add(angularXAxis);
53
54    // Add a series to better visualize the chart
55    const polarlineSeries = new PolarLineRenderableSeries(wasmContext, {
56        dataSeries: new XyDataSeries(wasmContext, {
57            xValues: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90],
58            yValues: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
59        }),
60        pointMarker: new EllipsePointMarker(wasmContext),
61        stroke: appTheme.VividOrange,
62        strokeThickness: 3
63    });
64    sciChartSurface.renderableSeries.add(polarlineSeries);
65
66    sciChartSurface.chartModifiers.add(
67        new PolarPanModifier(),
68        new PolarZoomExtentsModifier(),
69        new PolarMouseWheelZoomModifier({ growFactor: 0.0002 })
70    );
71
72    // sets new polarLabelMode
73    function changePolarLabelMode(newMode: EPolarLabelMode) {
74        angularXAxis.polarLabelMode = newMode;
75    }
76
77    return { 
78        sciChartSurface, 
79        wasmContext, 
80        controls: { 
81            changePolarLabelMode,
82            toggleIsInnerAxis: (isInnerAxis: boolean) => {
83                angularXAxis.isInnerAxis = isInnerAxis;
84                radialYAxis.isInnerAxis = isInnerAxis;
85            }
86        } 
87    };
88};

React Polar Label Mode Chart

Overview

This example demonstrates creating a polar chart with configurable label modes in React using SciChart.js. The implementation leverages the SciChartReact component to render a PolarNumericAxis with dynamic EPolarLabelMode configurations for angular axis labels.

Technical Implementation

The chart is initialized through the SciChartReact component using an initChart function that creates a SciChartPolarSurface with WebAssembly context. The angular axis supports polar label modes including Horizontal, Perpendicular, and Parallel orientations. The implementation follows polar chart layout principles with proper radial and angular axis configuration, enhanced by interactive polar modifiers for pan, zoom, and mouse wheel operations.

Features and Capabilities

The example provides runtime label mode switching through the changePolarLabelMode control function, enabling dynamic updates to angular axis label presentation. It includes PolarLineRenderableSeries with point markers for data visualization and supports inner axis positioning toggle functionality for flexible chart layouts.

Integration and Best Practices

React integration utilizes the SciChartReact wrapper component for seamless lifecycle management, ensuring proper chart initialization and cleanup. The modular design separates chart logic in drawExample.ts from React component structure, following React best practices for chart integration and component reusability.

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