Creates a JavaScript Polar Uniform Heatmap Chart using SciChart's powerful JavaScript Charts and its range of features.
drawExample.ts
index.html
vanilla.ts
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 example demonstrates a Polar Uniform Heatmap Chart in JavaScript using SciChart.js, visualizing intensity data in a circular coordinate system. The implementation features a heatmap with radial and angular axes, color gradients, and interactive modifiers.
The chart is created using SciChartPolarSurface.create() with a PolarUniformHeatmapRenderableSeries for heatmap rendering. Data is generated via generateHeatmapData() which produces a 2D array of normalized values. The heatmap uses a HeatmapColorMap with custom gradient stops for color representation. Polar axes are configured with PolarNumericAxis for radial (EPolarAxisMode.Radial) and angular (EPolarAxisMode.Angular) dimensions.
Key features include interactive modifiers like PolarPanModifier, PolarZoomExtentsModifier, and PolarMouseWheelZoomModifier for navigation. The heatmap legend is rendered separately using HeatmapLegend.create(), sharing the same color map for consistency. The example showcases performance-optimized rendering of 300x500 data points.
The implementation follows async initialization patterns for WebAssembly loading. Best practices include shared color mapping between chart and legend, and proper axis configuration for polar coordinates. For advanced usage, refer to the Polar Uniform Heatmap 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 JavaScript 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 JavaScript Multi-Cycle Polar Chart to plot data over multiple cycles and visualize patterns over time. This example shows surface temperature by month.

Try the JavaScript Polar Column or Bar Chart example to render bars in a polar layout with gradient fills and animations. Use SciChart for seamless integrations.

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

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

View the JavaScript Windrose Chart example to display directional data with stacked columns in a polar layout. Try the polar chart demo with customizable labels

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

View the JavaScript Radial Column Chart example to see the difference that SciChart has to offer. Switch radial and angular axes and add interactive modifiers.

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

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

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

Create a JavaScript Polar Chart with regular and interpolated error bands. Enhance a standard chart with shaded areas to show upper and lower data boundaries.

Build a JavaScript Polar Scatter Chart with this example to render multiple scatter series on radial and angular axes. Try the flexible SciChart demo today.

View the JavaScript Polar Radar Chart example. Also known as the Spider Radar Chart, view the scalability and stability that SciChart has to offer. Try demo.

Create JavaScript Gauge Charts, including a JavaScript Circular Gauge Dashboard, with user-friendly initialization and responsive design. Give SciChart a go.

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