Implementing Syncfusion React HeatMap Chart
The HeatMap component visualizes two-dimensional data using color gradients or fixed colors, making it ideal for analyzing patterns, correlations, and distributions across matrix data. Perfect for displaying heat patterns, activity matrices, performance data, and temporal correlations.
When to Use This Skill
- Visualizing 2D data patterns - Display matrix data with color-coded cells
- Creating heatmaps - Build interactive heatmaps with custom color schemes
- Analyzing correlations - Show relationships between row and column variables
- Displaying time-series patterns - Visualize activity over time periods
- Performance monitoring - Display metrics across multiple dimensions
- Data exploration - Reveal patterns in large datasets at a glance
- Configuring axes - Set up numerical, categorical, or datetime axes
- Customizing appearance - Apply custom colors, legends, and styling
- Handling user interaction - Implement selection, tooltips, and event handling
- Accessibility - Ensure keyboard navigation and screen reader support
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- Installation and setup steps
- Vite/React project configuration
- CSS imports and theme selection
- Basic component initialization
- When: Starting a new HeatMap implementation or setting up dependencies
Data Binding & Setup
📄 Read: references/data-binding.md
- JSON data format and structure
- 2D array binding
- Data transformation techniques
- Loading and binding data dynamically
- When: Preparing data for the heatmap or learning data formats
Axes Configuration
📄 Read: references/axes-configuration.md
- Numerical, categorical, and datetime axis types
- Axis properties and customization
- Inverted and opposed axis positioning
- Axis intervals and label formatting
- When: Setting up row/column headers or configuring axis behavior
Legend, Appearance & Styling
📄 Read: references/legend-and-appearance.md
- Legend placement, format, and customization
- Color palettes and gradient configuration
- Sizing and dimension properties
- Rendering modes (SVG vs Canvas switching)
- Theme styling and CSS customization
- When: Customizing visual appearance, colors, or legends
Interaction & Selection
📄 Read: references/interaction-and-selection.md
- Selection modes and cell highlighting
- Mouse events and event handlers
- Tooltip configuration and customization
- Cell interaction patterns and best practices
- When: Implementing user interaction or handling cell clicks/hovers
Advanced Features & Events
📄 Read: references/advanced-features.md
- Bubble heatmap implementation
- Complete event handling (select, click, hover, created)
- Automatic rendering mode switching
- Performance optimization for large datasets
- Custom rendering and cell styling
- When: Implementing advanced features or optimizing performance
API Reference
📄 Read: references/api-reference.md
- Comprehensive component API: props, methods, events, and model schemas
- Quick lookup for
cellSettings, legendSettings, paletteSettings, xAxis, yAxis, titleSettings, tooltipSettings, and common methods like export, print, clearSelection
- When: Adding or validating props, wiring events, or implementing advanced customizations
Accessibility & Troubleshooting
📄 Read: references/accessibility-and-troubleshooting.md
- WCAG compliance and accessibility features
- Keyboard navigation support
- ARIA attributes and screen reader support
- Common issues and solutions
- Migration from EJ1 to EJ2
- When: Ensuring accessibility or resolving issues
Quick Start
import * as React from 'react';
import { HeatMapComponent, Inject, Legend, Tooltip } from '@syncfusion/ej2-react-heatmap';
import '@syncfusion/ej2-base/styles/material.css';
export function App() {
const data = [
[73, 39, 26, 39, 94],
[93, 58, 53, 38, 26],
[54, 39, 26, 40, 42]
];
return (
<HeatMapComponent
id='heatmap'
dataSource={data}
xAxis={{ labels: ['A', 'B', 'C', 'D', 'E'] }}
yAxis={{ labels: ['X', 'Y', 'Z'] }}
showTooltip={true}
cellRender={(args) => {
args.displayText = args.value + '%';
}}
>
<Inject services={[Legend, Tooltip]} />
</HeatMapComponent>
);
}
export default App;
Common Patterns
Pattern 1: Basic Data Visualization
// Visualize simple 2D data with default styling
<HeatMapComponent
dataSource={data}
xAxis={{ labels: xLabels }}
yAxis={{ labels: yLabels }}
>
<Inject services={[Legend, Tooltip]} />
</HeatMapComponent>
Pattern 2: Custom Colors, Legend, and Tooltips
// Apply custom color palette with legend and styled tooltips
<HeatMapComponent
dataSource={data}
paletteSettings={{
type: 'Gradient',
palette: [
{ value: 0, color: '#3498db' },
{ value: 50, color: '#2ecc71' },
{ value: 100, color: '#e74c3c' }
]
}}
legendSettings={{ position: 'Right', width: '150px' }}
showTooltip={true}
tooltipSettings={{
fill: '#F5F5F5',
textStyle: { color: '#333333', size: '13px' },
border: { width: 1, color: '#999999' }
}}
>
<Inject services={[Legend, Tooltip]} />
</HeatMapComponent>
Pattern 3: Interactive Cell Handling
// Handle cell selection and display selected data
<HeatMapComponent
dataSource={data}
cellSelected={(args) => {
console.log(`Cell [${args.row}, ${args.column}] selected: ${args.value}`);
}}
cellRender={(args) => {
args.displayText = args.value + ' units';
}}
>
<Inject services={[Legend, Tooltip]} />
</HeatMapComponent>
Key Props
| Prop |
Type |
Purpose |
Example |
dataSource |
Array |
2D data array or JSON |
[[1,2],[3,4]] |
xAxis |
Object |
Column axis configuration |
{ labels: ['A', 'B'] } |
yAxis |
Object |
Row axis configuration |
{ labels: ['X', 'Y'] } |
paletteSettings |
Object |
Color palette and gradient configuration |
{ type: 'Gradient', palette: [{value: 0, color: '#blue'}] } |
cellRender |
Function |
Custom cell formatting |
Format display text |
cellSelected |
Function |
Selection event handler |
Track user selection |
legendSettings |
Object |
Legend placement/format |
{ position: 'Right' } |
showTooltip |
Boolean |
Enable/disable tooltips |
true or false |
tooltipSettings |
Object |
Tooltip styling (fill, textStyle, border) |
{ fill: '#F5F5F5', textStyle: { color: '#333' } } |
renderingMode |
String |
SVG or Canvas |
'Canvas' for large datasets |
Common Use Cases
- Performance Dashboard - Display metrics across departments and time periods
- Correlation Matrix - Visualize relationships between variables
- Activity Heatmap - Show user engagement patterns by day/hour
- Gene Expression - Analyze biological data with color intensity
- Traffic Pattern - Visualize network/website traffic distribution
- Survey Results - Display response patterns across questions and demographics
1---2name: syncfusion-react-heatmap3description: Implement Syncfusion React HeatMap Chart component for data visualization. Use this skill when user needs to create heatmaps, visualize 2D data patterns, display matrix data with color gradients, configure axes (numerical/categorical/datetime), implement legends, handle cell selection, apply custom styling, or work with large datasets. Covers installation, data binding, axis configuration, appearance customization, interaction patterns, tooltips, events, and accessibility.4---5
6# Implementing Syncfusion React HeatMap Chart
7
8The HeatMap component visualizes two-dimensional data using color gradients or fixed colors, making it ideal for analyzing patterns, correlations, and distributions across matrix data. Perfect for displaying heat patterns, activity matrices, performance data, and temporal correlations.
9
10## When to Use This Skill
11
12- **Visualizing 2D data patterns** - Display matrix data with color-coded cells
13- **Creating heatmaps** - Build interactive heatmaps with custom color schemes
14- **Analyzing correlations** - Show relationships between row and column variables
15- **Displaying time-series patterns** - Visualize activity over time periods
16- **Performance monitoring** - Display metrics across multiple dimensions
17- **Data exploration** - Reveal patterns in large datasets at a glance
18- **Configuring axes** - Set up numerical, categorical, or datetime axes
19- **Customizing appearance** - Apply custom colors, legends, and styling
20- **Handling user interaction** - Implement selection, tooltips, and event handling
21- **Accessibility** - Ensure keyboard navigation and screen reader support
22
23## Documentation and Navigation Guide
24
25### Getting Started
26📄 **Read:** [references/getting-started.md](references/getting-started.md)
27- Installation and setup steps
28- Vite/React project configuration
29- CSS imports and theme selection
30- Basic component initialization
31- **When:** Starting a new HeatMap implementation or setting up dependencies
32
33### Data Binding & Setup
34📄 **Read:** [references/data-binding.md](references/data-binding.md)
35- JSON data format and structure
36- 2D array binding
37- Data transformation techniques
38- Loading and binding data dynamically
39- **When:** Preparing data for the heatmap or learning data formats
40
41### Axes Configuration
42📄 **Read:** [references/axes-configuration.md](references/axes-configuration.md)
43- Numerical, categorical, and datetime axis types
44- Axis properties and customization
45- Inverted and opposed axis positioning
46- Axis intervals and label formatting
47- **When:** Setting up row/column headers or configuring axis behavior
48
49### Legend, Appearance & Styling
50📄 **Read:** [references/legend-and-appearance.md](references/legend-and-appearance.md)
51- Legend placement, format, and customization
52- Color palettes and gradient configuration
53- Sizing and dimension properties
54- Rendering modes (SVG vs Canvas switching)
55- Theme styling and CSS customization
56- **When:** Customizing visual appearance, colors, or legends
57
58### Interaction & Selection
59📄 **Read:** [references/interaction-and-selection.md](references/interaction-and-selection.md)
60- Selection modes and cell highlighting
61- Mouse events and event handlers
62- Tooltip configuration and customization
63- Cell interaction patterns and best practices
64- **When:** Implementing user interaction or handling cell clicks/hovers
65
66### Advanced Features & Events
67📄 **Read:** [references/advanced-features.md](references/advanced-features.md)
68- Bubble heatmap implementation
69- Complete event handling (select, click, hover, created)
70- Automatic rendering mode switching
71- Performance optimization for large datasets
72- Custom rendering and cell styling
73- **When:** Implementing advanced features or optimizing performance
74
75### API Reference
76📄 **Read:** [references/api-reference.md](references/api-reference.md)
77- Comprehensive component API: props, methods, events, and model schemas
78- Quick lookup for `cellSettings`, `legendSettings`, `paletteSettings`, `xAxis`, `yAxis`, `titleSettings`, `tooltipSettings`, and common methods like `export`, `print`, `clearSelection`
79- **When:** Adding or validating props, wiring events, or implementing advanced customizations
80
81### Accessibility & Troubleshooting
82📄 **Read:** [references/accessibility-and-troubleshooting.md](references/accessibility-and-troubleshooting.md)
83- WCAG compliance and accessibility features
84- Keyboard navigation support
85- ARIA attributes and screen reader support
86- Common issues and solutions
87- Migration from EJ1 to EJ2
88- **When:** Ensuring accessibility or resolving issues
89
90## Quick Start
91
92```jsx
93import * as React from 'react';
94import { HeatMapComponent, Inject, Legend, Tooltip } from '@syncfusion/ej2-react-heatmap';
95import '@syncfusion/ej2-base/styles/material.css';
96
97export function App() {
98 const data = [
99 [73, 39, 26, 39, 94],
100 [93, 58, 53, 38, 26],
101 [54, 39, 26, 40, 42]
102 ];
103
104 return (
105 <HeatMapComponent
106 id='heatmap'
107 dataSource={data}
108 xAxis={{ labels: ['A', 'B', 'C', 'D', 'E'] }}
109 yAxis={{ labels: ['X', 'Y', 'Z'] }}
110 showTooltip={true}
111 cellRender={(args) => {
112 args.displayText = args.value + '%';
113 }}
114 >
115 <Inject services={[Legend, Tooltip]} />
116 </HeatMapComponent>
117 );
118}
119
120export default App;
121```
122
123## Common Patterns
124
125### Pattern 1: Basic Data Visualization
126```jsx
127// Visualize simple 2D data with default styling
128<HeatMapComponent
129 dataSource={data}
130 xAxis={{ labels: xLabels }}
131 yAxis={{ labels: yLabels }}
132>
133 <Inject services={[Legend, Tooltip]} />
134</HeatMapComponent>
135```
136
137### Pattern 2: Custom Colors, Legend, and Tooltips
138```jsx
139// Apply custom color palette with legend and styled tooltips
140<HeatMapComponent
141 dataSource={data}
142 paletteSettings={{
143 type: 'Gradient',
144 palette: [
145 { value: 0, color: '#3498db' },
146 { value: 50, color: '#2ecc71' },
147 { value: 100, color: '#e74c3c' }
148 ]
149 }}
150 legendSettings={{ position: 'Right', width: '150px' }}
151 showTooltip={true}
152 tooltipSettings={{
153 fill: '#F5F5F5',
154 textStyle: { color: '#333333', size: '13px' },
155 border: { width: 1, color: '#999999' }
156 }}
157>
158 <Inject services={[Legend, Tooltip]} />
159</HeatMapComponent>
160```
161
162### Pattern 3: Interactive Cell Handling
163```jsx
164// Handle cell selection and display selected data
165<HeatMapComponent
166 dataSource={data}
167 cellSelected={(args) => {
168 console.log(`Cell [${args.row}, ${args.column}] selected: ${args.value}`);
169 }}
170 cellRender={(args) => {
171 args.displayText = args.value + ' units';
172 }}
173>
174 <Inject services={[Legend, Tooltip]} />
175</HeatMapComponent>
176```
177
178## Key Props
179
180| Prop | Type | Purpose | Example |
181|------|------|---------|---------|
182| `dataSource` | Array | 2D data array or JSON | `[[1,2],[3,4]]` |
183| `xAxis` | Object | Column axis configuration | `{ labels: ['A', 'B'] }` |
184| `yAxis` | Object | Row axis configuration | `{ labels: ['X', 'Y'] }` |
185| `paletteSettings` | Object | Color palette and gradient configuration | `{ type: 'Gradient', palette: [{value: 0, color: '#blue'}] }` |
186| `cellRender` | Function | Custom cell formatting | Format display text |
187| `cellSelected` | Function | Selection event handler | Track user selection |
188| `legendSettings` | Object | Legend placement/format | `{ position: 'Right' }` |
189| `showTooltip` | Boolean | Enable/disable tooltips | `true` or `false` |
190| `tooltipSettings` | Object | Tooltip styling (fill, textStyle, border) | `{ fill: '#F5F5F5', textStyle: { color: '#333' } }` |
191| `renderingMode` | String | SVG or Canvas | `'Canvas'` for large datasets |
192
193## Common Use Cases
194
1951. **Performance Dashboard** - Display metrics across departments and time periods
1962. **Correlation Matrix** - Visualize relationships between variables
1973. **Activity Heatmap** - Show user engagement patterns by day/hour
1984. **Gene Expression** - Analyze biological data with color intensity
1995. **Traffic Pattern** - Visualize network/website traffic distribution
2006. **Survey Results** - Display response patterns across questions and demographics
201
202---