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