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

Explore the React Polar Line Chart example to create data labels, line interpolation, gradient palette stroke and startup animations. Try the SciChart Demo.

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.

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.

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.

Create a React Polar Colum Category chart visualizing UK consumer price changes. Try the demo with a custom positive/negative threshold fill and stroke.

Create a React Polar Range Column Chart with SciChart. This example displays monthly minimum and maximum temperatures within a Polar layout. Try the demo.

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.

See the React Sunburst Chart example with multiple levels, smooth animation transitions and dynamically updating segment colors. Try the SciChart demo.

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.

This React Stacked Radial Bar Chart example shows Olympic medal data by country. Try the demo for yourself with async initialization and theme application.

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

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

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.

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.

Create React Gauge Charts, including a React Circular Gauge Dashboard, with React-friendly initialization and responsive design. Give the SciChart demo a go.

View React Arc Gauge Charts alongside FIFO Scrolling Charts, all on the same dashboard with real-time, high-performance data rendering. Try the demo.

Try SciChart's React Polar Heatmap example to combine a polar heatmap with a legend component. Supports responsive design and chart and legend separation.

No description available for this example yet

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.

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.

View the React Polar Map Example using the SciChartReact component. Display geographic data as color-coded triangles on a polar coordinate system. Try demo.