React Polar Radar Chart

Creates a React Polar Radar Chart, also known as a Spider Chart using SciChart.js, which expresses the complexity, memory usage, stability, adaptability, scalability, and cache efficiency of two popular sorting algorithms

This type of plot is also Known As: Spider Chart, Web Chart, Cobweb Chart, and Kiviat Chart

Fullscreen

Edit

 Edit

Docs

drawExample.ts

index.tsx

theme.ts

Copy to clipboard
Minimise
Fullscreen
1import {
2    PolarMouseWheelZoomModifier,
3    PolarZoomExtentsModifier,
4    PolarPanModifier,
5    XyDataSeries,
6    PolarNumericAxis,
7    SciChartPolarSurface,
8    EColor, 
9    EPolarAxisMode, 
10    EPolarGridlineMode, 
11    PolarCategoryAxis,
12    ENumericFormat,
13    EPolarLabelMode,
14    PolarMountainRenderableSeries,
15    FadeAnimation,
16    PolarLegendModifier,
17    EllipsePointMarker,
18    PolarLineRenderableSeries,
19} from "scichart";
20import { appTheme } from "../../../theme";
21
22const LABELS = [
23    "Complexity",
24    "Memory Usage",
25    "Stability",
26    "Adaptability",
27    "Scalability",
28    "Cache Efficiency"
29];
30
31const DATA_SET = [
32    {
33        name: "Quick Sort",
34        color: appTheme.VividSkyBlue,
35        values: [7, 8, 2, 8, 9, 9]
36    },
37    {   
38        name: "Bubble Sort",
39        color: appTheme.VividOrange,
40        values: [2, 9, 10, 5, 1, 2], 
41    },
42]
43
44// this chart expresses the complexity, memory usage, stability, adaptability, scalability, and cache efficiency of two sorting algorithms
45
46export const drawExample = async (rootElement: string | HTMLDivElement) => {
47    const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(rootElement, {
48        theme: appTheme.SciChartJsTheme
49    });
50
51    const radialYAxis = new PolarNumericAxis(wasmContext, {
52        polarAxisMode: EPolarAxisMode.Radial,
53        gridlineMode: EPolarGridlineMode.Polygons,
54        useNativeText: true,
55        labelPrecision: 0,
56        zoomExtentsToInitialRange: true,
57
58        majorGridLineStyle: {
59            color: EColor.BackgroundColor,
60            strokeThickness: 1,
61            strokeDashArray: [5, 5]
62        },
63        drawLabels: false,
64        drawMinorGridLines: false,
65        drawMajorTickLines: false,
66        drawMinorTickLines: false,
67        startAngle: Math.PI / 2, // start at 12 o'clock
68        innerRadius: 0, 
69    });
70    sciChartSurface.yAxes.add(radialYAxis); 
71
72    const angularXAxis = new PolarCategoryAxis(wasmContext, {
73        polarAxisMode: EPolarAxisMode.Angular,
74        labels: LABELS,
75        majorGridLineStyle: {
76            color: EColor.BackgroundColor,
77            strokeThickness: 1,
78            strokeDashArray: [5, 5]
79        },
80        flippedCoordinates: true, // go clockwise
81        drawMinorGridLines: false,
82        useNativeText: true,
83        polarLabelMode: EPolarLabelMode.Horizontal,
84        labelFormat: ENumericFormat.NoFormat,
85        startAngle: Math.PI / 2, // start at 12 o'clock
86    });
87    sciChartSurface.xAxes.add(angularXAxis);
88
89    const xValues = Array.from({ length: LABELS.length + 1 }, (_, i) => i); 
90    // +1 to complete the radar chart without overlap of first and last labels
91    
92    const polarMountain = new PolarMountainRenderableSeries(wasmContext, {
93        dataSeries: new XyDataSeries(wasmContext, {
94            xValues: xValues,
95            yValues: [...DATA_SET[0].values, DATA_SET[0].values[0]], // +1 append first value to complete the radar chart
96            dataSeriesName: DATA_SET[0].name
97        }),
98        stroke: DATA_SET[0].color,
99        fill: DATA_SET[0].color + "30",
100        strokeThickness: 4,
101        animation: new FadeAnimation({ duration: 1000 })
102    });
103    sciChartSurface.renderableSeries.add(polarMountain);
104
105    // You can just as well use a PolarLineRenderableSeries
106    const polarLine = new PolarLineRenderableSeries(wasmContext, {
107        dataSeries: new XyDataSeries(wasmContext, {
108            xValues: xValues,
109            yValues: [...DATA_SET[1].values, DATA_SET[1].values[0]], // +1 append first value to complete the radar chart
110            dataSeriesName: DATA_SET[1].name
111        }),
112        stroke: DATA_SET[1].color,
113        strokeThickness: 4,
114        pointMarker: new EllipsePointMarker(wasmContext, {
115            width: 10,
116            height: 10,
117            strokeThickness: 2,
118            fill: DATA_SET[1].color,
119            stroke: EColor.White,
120        }),
121        animation: new FadeAnimation({ duration: 1000 })
122    });
123    sciChartSurface.renderableSeries.add(polarLine);
124
125    sciChartSurface.chartModifiers.add(
126        new PolarPanModifier(),
127        new PolarZoomExtentsModifier(),
128        new PolarMouseWheelZoomModifier({ growFactor: 0.0002 }),
129        new PolarLegendModifier({ showSeriesMarkers: true, showCheckboxes: true }),
130    );
131
132    return { sciChartSurface, wasmContext };
133};
134

React Polar Radar Chart

Overview

This example demonstrates how to create a high-performance Polar Radar Chart in React using SciChart.js, visualizing the complexity, memory usage, stability, adaptability, scalability, and cache efficiency of Quick Sort and Bubble Sort algorithms through polar series.

Technical Implementation

The chart is initialized asynchronously via the SciChartReact component, creating a SciChartPolarSurface with a custom theme. It configures a PolarNumericAxis for radial values and a PolarCategoryAxis for angular labels, adding PolarMountainRenderableSeries and PolarLineRenderableSeries with XyDataSeries for data visualization. Performance is optimized through WebGL rendering and native text usage, as detailed in the Polar Radar Chart documentation.

Features and Capabilities

The chart supports real-time updates via data series modifications and includes advanced customizations like fade animations, point markers, and interactive modifiers such as PolarPanModifier, PolarZoomExtentsModifier, and PolarLegendModifier for enhanced user interaction.

Integration and Best Practices

Integration in React uses the SciChartReact wrapper for seamless chart lifecycle management, ensuring proper initialization and cleanup. Follow best practices for async setup and theming to maintain performance in dynamic applications.

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