Creates a React Polar Uniform Heatmap Chart using SciChart's powerful JavaScript Charts and its range of features.
drawExample.ts
index.tsx
theme.ts
generateHeatmapData.ts
1import {
2 PolarMouseWheelZoomModifier,
3 PolarZoomExtentsModifier,
4 PolarPanModifier,
5 PolarNumericAxis,
6 SciChartPolarSurface,
7 EPolarAxisMode,
8 NumberRange,
9 EAxisAlignment,
10 EPolarLabelMode,
11 HeatmapColorMap,
12 UniformHeatmapDataSeries,
13 PolarUniformHeatmapRenderableSeries,
14 HeatmapLegend,
15 Thickness,
16} from "scichart";
17import { appTheme } from "../../../theme";
18import { generateHeatmapData } from "./generateHeatmapData";
19
20const HEATMAP_WIDTH = 300;
21const HEATMAP_HEIGHT = 500;
22
23// Define color map globally to be used in both the chart and the legend
24const COLOR_MAP = new HeatmapColorMap({
25 minimum: 0,
26 maximum: 1,
27 gradientStops: [
28 { offset: 0, color: appTheme.VividPink },
29 { offset: 0.1, color: appTheme.VividOrange },
30 { offset: 0.2, color: appTheme.MutedRed },
31 { offset: 0.5, color: appTheme.VividGreen },
32 { offset: 0.8, color: appTheme.VividSkyBlue },
33 { offset: 0.9, color: appTheme.Indigo },
34 { offset: 1, color: appTheme.DarkIndigo },
35 ]
36})
37
38export const drawExample = async (rootElement: string | HTMLDivElement) => {
39 const { sciChartSurface, wasmContext } = await SciChartPolarSurface.create(rootElement, {
40 theme: appTheme.SciChartJsTheme,
41 padding: new Thickness(0, 60, 0, 0)
42 });
43
44 const radialAxisY = new PolarNumericAxis(wasmContext, {
45 polarAxisMode: EPolarAxisMode.Radial,
46 axisAlignment: EAxisAlignment.Right,
47 visibleRangeLimit: new NumberRange(0, HEATMAP_HEIGHT),
48 useNativeText: true,
49 drawMinorGridLines: false,
50
51 drawMajorTickLines: false,
52 drawMinorTickLines: false,
53 labelPrecision: 0,
54 innerRadius: 0.2
55 });
56 sciChartSurface.yAxes.add(radialAxisY);
57
58 const angularAxisX = new PolarNumericAxis(wasmContext, {
59 polarAxisMode: EPolarAxisMode.Angular,
60 axisAlignment: EAxisAlignment.Top,
61 flippedCoordinates: true,
62 useNativeText: true,
63
64 drawMajorTickLines: false,
65 drawMinorTickLines: false,
66 polarLabelMode: EPolarLabelMode.Parallel,
67 labelPrecision: 0,
68 totalAngle: Math.PI / 2
69 });
70 sciChartSurface.xAxes.add(angularAxisX);
71
72 const heatmapSeries = new PolarUniformHeatmapRenderableSeries(wasmContext, {
73 dataSeries: new UniformHeatmapDataSeries(wasmContext, {
74 zValues: generateHeatmapData(HEATMAP_WIDTH, HEATMAP_HEIGHT, 1999),
75 xStart: 0,
76 xStep: 1,
77 yStart: 0,
78 yStep: 1,
79 }),
80 colorMap: COLOR_MAP,
81 stroke: "white",
82 strokeThickness: 5,
83 });
84 sciChartSurface.renderableSeries.add(heatmapSeries);
85
86 sciChartSurface.chartModifiers.add(
87 new PolarPanModifier(),
88 new PolarZoomExtentsModifier(),
89 new PolarMouseWheelZoomModifier()
90 );
91
92 return { sciChartSurface, wasmContext };
93};
94
95// Draws a Heatmap legend over the <div id={divHeatmapLegend}></div>
96export const drawHeatmapLegend = async (rootElement: string | HTMLDivElement) => {
97 const { heatmapLegend } = await HeatmapLegend.create(rootElement, {
98 theme: {
99 ...appTheme.SciChartJsTheme,
100 sciChartBackground: appTheme.DarkIndigo + "BB",
101 loadingAnimationBackground: appTheme.DarkIndigo + "BB",
102 },
103 yAxisOptions: {
104 isInnerAxis: true,
105 labelStyle: {
106 fontSize: 14,
107 color: appTheme.ForegroundColor,
108 },
109 axisBorder: {
110 borderRight: 2,
111 color: appTheme.ForegroundColor,
112 },
113 majorTickLineStyle: {
114 color: appTheme.ForegroundColor,
115 tickSize: 8,
116 strokeThickness: 2,
117 },
118 minorTickLineStyle: {
119 color: appTheme.ForegroundColor,
120 tickSize: 4,
121 strokeThickness: 1,
122 },
123 },
124 colorMap: COLOR_MAP
125 });
126
127 return { sciChartSurface: heatmapLegend.innerSciChartSurface.sciChartSurface };
128};This React example showcases a Polar Uniform Heatmap Chart using SciChart.js, integrating the heatmap visualization into a React component. The implementation combines the polar heatmap with a standalone legend component.
The chart is rendered using SciChartReact component with initChart={drawExample} prop. The heatmap surface and legend are separate instances, both using the shared COLOR_MAP for consistent coloring. The main chart features polar axes configured with innerRadius and totalAngle properties to control the circular layout.
The example demonstrates React-specific integration patterns while maintaining all JavaScript features: heatmap rendering, polar coordinate system, and interactive modifiers. The legend is positioned absolutely within the component layout, showcasing React's composition capabilities.
The implementation uses SciChart's React wrapper (scichart-react) for seamless integration. Best practices include proper component structure for chart and legend separation, and responsive styling. For React-specific guidance, see SciChart React documentation.

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.

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.

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.

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.