Angular UI Components Documentation
The Angular HeatMap shows a matrix of values as coloured cells, on a gradient or a fixed colour scale, with a legend and tooltips. This guide adds the Angular HeatMap (jqxHeatMap) to an app, then shows how to set its options and call its methods.
jqwidgets-ngjqwidgets-ng/jqxheatmap 
In an Angular project (to start one, see Getting started with Angular), add the package with the Angular CLI. It asks for a theme and adds the styles to angular.json:
ng add jqwidgets-ng
Components are standalone: add jqxHeatMapModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxHeatMapModule } from 'jqwidgets-ng/jqxheatmap';
@Component({
selector: 'app-root',
imports: [jqxHeatMapModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<jqxHeatMap [xAxis]="xAxis" [yAxis]="yAxis" [source]="data" [title]="'Car sales revenue per employee(in 1000 €)'">
</jqxHeatMap>
import { Component, ViewEncapsulation } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { jqxHeatMapModule } from 'jqwidgets-ng/jqxheatmap';
@Component({
imports: [CommonModule, FormsModule, jqxHeatMapModule],
selector: 'app-root',
templateUrl: './app.html',
styleUrl: './app.css',
encapsulation: ViewEncapsulation.None
})
export class App {
xAxis: object = {
labels: [
'John',
'Marry',
'Alba',
'Steven',
'Josh',
'Alica',
'Robert',
'Kim',
'Ann',
'Paul',
'Regina',
'Dorothy'
]
};
yAxis: object = { labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] };
data: number[][] = [
[89, 39, 94, 55, 3],
[53, 38, 26, 68, 33],
[22, 0, 66, 90, 78],
[97, 68, 68, 3, 99],
[47, 47, 88, 6, 1],
[73, 23, 3, 79, 100],
[21, 86, 13, 33, 0],
[53, 81, 95, 79, 66],
[74, 68, 88, 51, 43],
[10, 12, 78, 14, 21],
[55, 58, 12, 82, 99],
[88, 23, 86, 59, 53]
];
}
Options are inputs, bound with [name]="value".
Get the component with a signal query and call its methods. For example, setLegendPosition: Sets legend's position.
<jqxHeatMap #myHeatMap></jqxHeatMap>
import { Component, viewChild } from '@angular/core';
import { jqxHeatMapModule, jqxHeatMapComponent } from 'jqwidgets-ng/jqxheatmap';
@Component({
selector: 'app-root',
imports: [jqxHeatMapModule],
templateUrl: './app.html'
})
export class App {
readonly myHeatMap = viewChild.required<jqxHeatMapComponent>('myHeatMap');
run(): void {
this.myHeatMap().setLegendPosition('Bottom');
}
}