Search results

HeatMapComponent

ejs-heatmap represents the Angular HeatMap Component.

<ejs-heatmap></ejs-heatmap>

Properties

allowSelection

boolean

Enable or disable the selection of multiple cells in heatmap

    <ejs-heatmap id='container' style="display:block;" [dataSource]='dataSource' [xAxis]='xAxis' [yAxis]='yAxis' [allowSelection]='allowSelection'></ejs-heatmap>
    import { Component, ViewEncapsulation } from '@angular/core';
    import { HeatMap } from '@syncfusion/ej2-angular-heatmap';

    /**
    * HeatMap default sample
    */
    @Component({
        selector: 'app-root',
        templateUrl: 'app.component.html',
        encapsulation: ViewEncapsulation.None
    })
    export class AppComponent {
        allowSelection: boolean = true;
        dataSource: Object[] = [
            [73, 39, 26, 39, 94, 0],
            [93, 58, 53, 38, 26, 68],
            [99, 28, 22, 4, 66, 90],
            [14, 26, 97, 69, 69, 3],
            [7, 46, 47, 47, 88, 6],
            [41, 55, 73, 23, 3, 79]
            ];
    }

Defaults to false

backgroundColor

string

Specifies the background color of the entire heatmap.

Defaults to null

cellSettings

CellSettingsModel

Options to customize the heat map cell

    <ejs-heatmap id='container' style="display:block;" [cellSettings]='cellSettings'  [dataSource]='dataSource'>
    </ejs-heatmap>
    import { Component, ViewEncapsulation } from '@angular/core';
    import { HeatMap } from '@syncfusion/ej2-angular-heatmap';

    /**
    * HeatMap default sample
    */
    @Component({
        selector: 'app-root',
        templateUrl: 'app.component.html',
        encapsulation: ViewEncapsulation.None
    })
    export class AppComponent {
        dataSource: Object[] = [
            [73, 39, 26, 39, 94, 0],
            [93, 58, 53, 38, 26, 68],
            [99, 28, 22, 4, 66, 90],
            [14, 26, 97, 69, 69, 3],
            [7, 46, 47, 47, 88, 6],
            [41, 55, 73, 23, 3, 79]
        ];
        public cellSettings: Object = {
            showLabel: false
        };
    }

dataSource

Object

Specifies the datasource for the heat map.

Defaults to null

dataSourceSettings

DataModel

Specifies the datasource settings for heat map.

    <ejs-heatmap id='container' style="display:block;" [dataSource]='dataSource' [dataSourceSettings]='dataSourceSettings'></ejs-heatmap>
    import { Component, ViewEncapsulation } from '@angular/core';
    import { HeatMap } from '@syncfusion/ej2-angular-heatmap';

    /**
    * HeatMap default sample
    */
    @Component({
        selector: 'app-root',
        templateUrl: 'app.component.html',
        encapsulation: ViewEncapsulation.None
    })
    export class AppComponent {
        dataSource: Object[] = [
            [0, 0, 10.75], [0, 1, 14.5], [0, 2, 25.5], [0, 3, 39.5], [0, 4, 59.75], [0, 5, 35.50], [0, 6, 75.5],
            [1, 0, 20.75], [1, 1, 35.5], [1, 2, 29.5], [1, 3, 75.5], [1, 4, 80], [1, 5, 65], [1, 6, 85],
            [2, 0, 6], [2, 1, 18.5], [2, 2, 30.05], [2, 3, 35.5], [2, 4, 40.75], [2, 5, 50.75], [2, 6, 65],
            [3, 0, 30.5], [3, 1, 20.5], [3, 2, 45.30], [3, 3, 50], [3, 4, 55], [3, 5, 85.80], [3, 6, 87.5],
            [4, 0, 10.5], [4, 1, 20.75], [4, 2, 35.5], [4, 3, 35.5], [4, 4, 45.5], [4, 5, 65.], [4, 6, 75.5],
            [5, 0, 45.5], [5, 1, 20.75], [5, 2, 45.5], [5, 3, 50.75], [5, 4, 79.30], [5, 5, 84.20], [5, 6, 87.36],
            [6, 0, 26.82], [6, 1, 70], [6, 2, 75], [6, 3, 79.5], [6, 4, 88.5], [6, 5, 89.5], [6, 6, 91.75],
        ];
        dataSourceSettings: Object = {
            adaptorType: 'Cell'
        };
    }

enableMultiSelect

boolean

Enable or disable the multiple selection of cells in heatmap.

Defaults to true

enablePersistence

boolean

Enable or disable persisting component’s state between page reloads.

Defaults to false

enableRtl

boolean

Enable or disable rendering component in right to left direction.

Defaults to false

height

string

The height of the heatmap accepts pixel values given in string format.

Defaults to null

legendSettings

LegendSettingsModel

Options for customizing the legend of the heat map

    <ejs-heatmap id='container' style="display:block;" [dataSource]='dataSource'   [legendSettings]='legendSettings'></ejs-heatmap>
    import { Component, ViewEncapsulation } from '@angular/core';
    import { HeatMap } from '@syncfusion/ej2-angular-heatmap';

    /**
    * HeatMap default sample
    */
    @Component({
        selector: 'app-root',
        templateUrl: 'app.component.html',
        encapsulation: ViewEncapsulation.None
    })
    export class AppComponent {
        dataSource: Object[] = [
            [73, 39, 26, 39, 94, 0],
            [93, 58, 53, 38, 26, 68],
            [99, 28, 22, 4, 66, 90],
            [14, 26, 97, 69, 69, 3],
            [7, 46, 47, 47, 88, 6],
            [41, 55, 73, 23, 3, 79],
        ];
        public legendSettings: Object = {
            position: 'Top',
        };
    }

Defaults to

locale

string

Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.

Defaults to

margin

MarginModel

Options to customize left, right, top and bottom margins of the heat map.

paletteSettings

PaletteSettingsModel

Options for customizing the cell color of the heat map

renderingMode

DrawType

Specifies the rendering mode of heat map.

  • SVG - Heat map is render using SVG draw mode.
  • Canvas - Heat map is render using Canvas draw mode.
  • Auto - Automatically switch the draw mode based on number of records in data source.

Defaults to SVG

showTooltip

boolean

Enable or disable the tool tip for heatmap

Defaults to true

theme

HeatMapTheme

Specifies the theme for heatmap.

Defaults to ‘Material’

titleSettings

TitleModel

Title of heat map

    <ejs-heatmap id='container' style="display:block;" [dataSource]='dataSource' [titleSettings]='titleSettings'></ejs-heatmap>
    import { Component, ViewEncapsulation } from '@angular/core';
    import { HeatMap } from '@syncfusion/ej2-angular-heatmap';

    /**
    * HeatMap default sample
    */
    @Component({
        selector: 'app-root',
        templateUrl: 'app.component.html',
        encapsulation: ViewEncapsulation.None
    })
    export class AppComponent {
        titleSettings: Object = {
            text: 'Sales Revenue per Employee (in 1000 US$)',
            textStyle: {
                size: '15px',
                fontWeight: '500',
                fontStyle: 'Italic',
                fontFamily: 'Courier New'
            }
        };
        dataSource: Object[] = [
            [73, 39, 26, 39, 94, 0],
            [93, 58, 53, 38, 26, 68],
            [99, 28, 22, 4, 66, 90],
            [14, 26, 97, 69, 69, 3],
            [7, 46, 47, 47, 88, 6],
            [41, 55, 73, 23, 3, 79],
            [56, 69, 21, 86, 3, 33],
            [45, 7, 53, 81, 95, 79],
            [60, 77, 74, 68, 88, 51],
            [25, 25, 10, 12, 78, 14],
            [25, 56, 55, 58, 12, 82],
            [74, 33, 88, 23, 86, 59]
        ];
    }

Defaults to

tooltipSettings

TooltipSettingsModel

Options for customizing the ToolTipSettings property of the heat map

    <ejs-heatmap id='container' style="display:block;" [dataSource]='dataSource' [tooltipSettings]='tooltipSettings'></ejs-heatmap>
    import { Component, ViewEncapsulation } from '@angular/core';
    import { HeatMap } from '@syncfusion/ej2-angular-heatmap';

    /**
    * HeatMap default sample
    */
    @Component({
        selector: 'app-root',
        templateUrl: 'app.component.html',
        encapsulation: ViewEncapsulation.None
    })
    export class AppComponent {
        public tooltipSettings: Object = {
            fill: '#696295',
            textStyle: {
                color: '#FFFFFF',
                size: '12px'
            },
            border: {
                width: 2,
                color: '#F0C27B'
            }
        };
        dataSource: Object[] = [
            [73, 39, 26, 39, 94, 0],
            [93, 58, 53, 38, 26, 68],
            [99, 28, 22, 4, 66, 90],
            [14, 26, 97, 69, 69, 3],
            [7, 46, 47, 47, 88, 6],
            [41, 55, 73, 23, 3, 79],
            [56, 69, 21, 86, 3, 33],
            [45, 7, 53, 81, 95, 79],
            [60, 77, 74, 68, 88, 51],
            [25, 25, 10, 12, 78, 14],
            [25, 56, 55, 58, 12, 82],
            [74, 33, 88, 23, 86, 59]
        ];
    }

width

string

The width of the heatmap as a string accepts input as both like ‘100px’ or ‘100%‘. If specified as ‘100%, heatmap renders to the full width of its parent element.

Defaults to null

xAxis

AxisModel

Options to configure the horizontal axis.

yAxis

AxisModel

Options to configure the vertical axis.

Methods

clearSelection

To clear the multi cell selection

    <ejs-heatmap #heatmap id='container' style="display:block;" allowSelection="true" [dataSource]='dataSource'></ejs-heatmap>
    <button (click)='clear()' id='submit'>Clear Selection</button>
    import { Component, ViewEncapsulation, ViewChild  } from '@angular/core';
    import { HeatMap, HeatMapComponent ,ILoadedEventArgs, HeatMapTheme, SeriesModel } from '@syncfusion/ej2-angular-heatmap';

    /**
    * HeatMap default sample
    */
    @Component({
        selector: 'app-root',
        templateUrl: 'app.component.html',
        encapsulation: ViewEncapsulation.None
    })
    export class AppComponent {
        dataSource: Object[] = [
            [73, 39, 26, 39, 94, 0],
            [93, 58, 53, 38, 26, 68],
            [99, 28, 22, 4, 66, 90],
            [14, 26, 97, 69, 69, 3],
            [7, 46, 47, 47, 88, 6],
            [41, 55, 73, 23, 3, 79],
            [56, 69, 21, 86, 3, 33],
            [45, 7, 53, 81, 95, 79],
            [60, 77, 74, 68, 88, 51],
            [25, 25, 10, 12, 78, 14],
            [25, 56, 55, 58, 12, 82],
            [74, 33, 88, 23, 86, 59]
        ];
        @ViewChild('heatmap')
        public heatmap: HeatMapComponent;
        public clear = function(event: any): void {
            this.heatmap.clearSelection();
        }  
    }

Returns void

destroy

To destroy the widget

  <ejs-heatmap #heatmap id='container' style="display:block;" [dataSource]='dataSource'></ejs-heatmap>
  <button class="e-control e-btn" (click)="destroy()">Destroy</button>
  import { Component, ViewEncapsulation, ViewChild  } from '@angular/core';
  import { HeatMap, HeatMapComponent ,ILoadedEventArgs, HeatMapTheme } from '@syncfusion/ej2-angular-heatmap';

  /**
  * HeatMap default sample
  */
  @Component({
    selector: 'app-root',
    templateUrl: 'app.component.html',
    encapsulation: ViewEncapsulation.None
  })
  export class AppComponent {
    dataSource: Object[] = [
      [73, 39, 26, 39, 94, 0],
      [93, 58, 53, 38, 26, 68],
      [99, 28, 22, 4, 66, 90],
      [14, 26, 97, 69, 69, 3],
      [7, 46, 47, 47, 88, 6],
      [41, 55, 73, 23, 3, 79],
      [56, 69, 21, 86, 3, 33],
      [45, 7, 53, 81, 95, 79],
      [60, 77, 74, 68, 88, 51],
      [25, 25, 10, 12, 78, 14],
      [25, 56, 55, 58, 12, 82],
      [74, 33, 88, 23, 86, 59]
    ];
    @ViewChild('heatmap')
    public heatmap: HeatMapComponent;
    public destroy = function(event: any): void {
      this.heatmap.destroy();
    }  
  }

Returns void

export

Handles the export method for heatmap control.

Returns void

getModuleName

Get component name

Returns string

print

Method to print the heatmap.

Returns void

refresh

Applies all the pending property changes and render the component again.

Returns void

Events

cellClick

EmitType<ICellClickEventArgs>

Triggers when click the heat map cell.

cellRender

EmitType<ICellEventArgs>

Triggers before each heatmap cell renders.

    <html>
        <head>
            <link href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet">
            <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
        </head>

        <body>
            <div id="container"> </div>
        </body>
    </html>
  import { enableRipple } from '@syncfusion/ej2-base';
  enableRipple(true);

  import { HeatMap, Legend, Tooltip, ILoadedEventArgs, HeatMapTheme, ICellEventArgs } from '@syncfusion/ej2-heatmap';
  HeatMap.Inject(Tooltip, Legend);

  /**
   * Sample for Line serie
   */
  let heatmapData: any[] = [
    [73, 39, 26, 39, 94, 0],
    [93, 58, 53, 38, 26, 68],
    [99, 28, 22, 4, 66, 90],
    [14, 26, 97, 69, 69, 3],
    [7, 46, 47, 47, 88, 6],
    [41, 55, 73, 23, 3, 79],
    [56, 69, 21, 86, 3, 33],
    [45, 7, 53, 81, 95, 79],
    [60, 77, 74, 68, 88, 51],
    [25, 25, 10, 12, 78, 14],
    [25, 56, 55, 58, 12, 82],
    [74, 33, 88, 23, 86, 59]
  ];

  let heatmap: HeatMap = new HeatMap({
    titleSettings: {
      text: 'Sales Revenue per Employee (in 1000 US$)',
      textStyle: {
        size: '15px',
        fontWeight: '500',
        fontStyle: 'Italic',
        fontFamily: 'Courier New'
      }
    },
    xAxis: {
      labels: ['Nancy', 'Andrew', 'Janet', 'Margaret', 'Steven',
        'Michael', 'Robert', 'Laura', 'Anne', 'Paul', 'Karin', 'Mario'],
    },
    yAxis: {
      labels: ['Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat'],
    },
    cellSettings: {
      showLabel: true,
    },
    tooltipSettings: {
      fill: '#696295',
      textStyle: {
        color: '#FFFFFF',
        size: '12px'
      },
      border: {
        width: 2,
        color: '#F0C27B'
      }
    },
    cellRender: (args: ICellEventArgs) => {
      args.displayText = '$ ' + (args.value / 2) + 'K';
    },
    dataSource: heatmapData,
  });
  heatmap.appendTo('#container');

cellSelected

EmitType<ISelectedEventArgs>

Triggers when multiple cells gets selected.

created

EmitType<Object>

Triggers after heat map rendered.

legendRender

EmitType<ILegendRenderEventArgs>

Triggers before the legend is rendered.

    <html>
        <head>
            <link href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet">
            <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
        </head>

        <body>
            <div id="container"> </div>
        </body>
    </html>
    import { enableRipple } from '@syncfusion/ej2-base';
    enableRipple(true);

    import { HeatMap, Legend, Tooltip, ILoadedEventArgs, HeatMapTheme, ILegendRenderEventArgs } from '@syncfusion/ej2-heatmap';
    HeatMap.Inject(Tooltip, Legend);

    /**
    * Sample for Line serie
    */
    let heatmapData: any[] = [
        [73, 39, 26, 39, 94, 0],
        [93, 58, 53, 38, 26, 68],
        [99, 28, 22, 4, 66, 90],
        [14, 26, 97, 69, 69, 3],
        [7, 46, 47, 47, 88, 6],
        [41, 55, 73, 23, 3, 79],
        [56, 69, 21, 86, 3, 33],
        [45, 7, 53, 81, 95, 79],
        [60, 77, 74, 68, 88, 51],
        [25, 25, 10, 12, 78, 14],
        [25, 56, 55, 58, 12, 82],
        [74, 33, 88, 23, 86, 59]
    ];

    let heatmap: HeatMap = new HeatMap({
        titleSettings: {
            text: 'Sales Revenue per Employee (in 1000 US$)',
            textStyle: {
                size: '15px',
                fontWeight: '500',
                fontStyle: 'Normal',
                fontFamily: 'Segoe UI'
        }
        },
        xAxis: {
            labels: ['Nancy', 'Andrew', 'Janet', 'Margaret', 'Steven',
            'Michael', 'Robert', 'Laura', 'Anne', 'Paul', 'Karin', 'Mario'],
        },
        yAxis: {
            labels: ['Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat'],
        },
        allowSelection: true,
        legendRender: (args: ILegendRenderEventArgs) => {
            args.text = args.text +'k';
        },
        dataSource: heatmapData,
    });
    heatmap.appendTo('#container');

load

EmitType<ILoadedEventArgs>

Triggers before heat map load.

    <html>
        <head>
            <link href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet">
            <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
        </head>

        <body>
            <div id="container"> </div>
        </body>
    </html>
    import { enableRipple } from '@syncfusion/ej2-base';
    enableRipple(true);

    import { HeatMap, Legend, Tooltip, ILoadedEventArgs, HeatMapTheme } from '@syncfusion/ej2-heatmap';
    HeatMap.Inject(Tooltip, Legend);

  /**
  * Sample for Line serie
  */
    let heatmapData: any[] = [
        [73, 39, 26, 39, 94, 0],
        [93, 58, 53, 38, 26, 68],
        [99, 28, 22, 4, 66, 90],
        [14, 26, 97, 69, 69, 3],
        [7, 46, 47, 47, 88, 6],
        [41, 55, 73, 23, 3, 79],
        [56, 69, 21, 86, 3, 33],
        [45, 7, 53, 81, 95, 79],
        [60, 77, 74, 68, 88, 51],
        [25, 25, 10, 12, 78, 14],
        [25, 56, 55, 58, 12, 82],
        [74, 33, 88, 23, 86, 59]
    ];

    let heatmap: HeatMap = new HeatMap({
        titleSettings: {
            text: 'Sales Revenue per Employee (in 1000 US$)',
            textStyle: {
                size: '15px',
                fontWeight: '500',
                fontStyle: 'Normal',
                fontFamily: 'Segoe UI'
        }
        },
        xAxis: {
            labels: ['Nancy', 'Andrew', 'Janet', 'Margaret', 'Steven',
            'Michael', 'Robert', 'Laura', 'Anne', 'Paul', 'Karin', 'Mario'],
        },
        yAxis: {
            labels: ['Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat'],
        },
        allowSelection: true,
        load: (args: ILoadedEventArgs) => {
            alert('Heatmap rendered successfully');
            let selectedTheme: string = location.hash.split('/')[1];
            selectedTheme = selectedTheme ? selectedTheme : 'Material';
            args.heatmap.theme = <HeatMapTheme>(selectedTheme.charAt(0).toUpperCase() + selectedTheme.slice(1));
        },
        dataSource: heatmapData,
    });
  heatmap.appendTo('#container');

loaded

EmitType<ILoadedEventArgs>

Triggers after heatmap is loaded.

resized

EmitType<IResizeEventArgs>

Triggers after resizing of Heatmap.

tooltipRender

EmitType<ITooltipEventArgs>

Triggers when click the heat map cell.

    <html>
        <head>
            <link href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet">
            <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
        </head>

        <body>
            <div id="container"> </div>
        </body>
    </html>
    import { enableRipple } from '@syncfusion/ej2-base';
    enableRipple(true);

    import { HeatMap, Legend, Tooltip, ILoadedEventArgs, HeatMapTheme, ITooltipEventArgs } from '@syncfusion/ej2-heatmap';
    HeatMap.Inject(Tooltip, Legend);

    /**
    * Sample for Line serie
    */
    let heatmapData: any[] = [
        [73, 39, 26, 39, 94, 0],
        [93, 58, 53, 38, 26, 68],
        [99, 28, 22, 4, 66, 90],
        [14, 26, 97, 69, 69, 3],
        [7, 46, 47, 47, 88, 6],
        [41, 55, 73, 23, 3, 79],
        [56, 69, 21, 86, 3, 33],
        [45, 7, 53, 81, 95, 79],
        [60, 77, 74, 68, 88, 51],
        [25, 25, 10, 12, 78, 14],
        [25, 56, 55, 58, 12, 82],
        [74, 33, 88, 23, 86, 59]
    ];

    let heatmap: HeatMap = new HeatMap({
        titleSettings: {
            text: 'Sales Revenue per Employee (in 1000 US$)',
            textStyle: {
                size: '15px',
                fontWeight: '500',
                fontStyle: 'Normal',
                fontFamily: 'Segoe UI'
        }
        },
        xAxis: {
            labels: ['Nancy', 'Andrew', 'Janet', 'Margaret', 'Steven',
            'Michael', 'Robert', 'Laura', 'Anne', 'Paul', 'Karin', 'Mario'],
        },
        yAxis: {
            labels: ['Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat'],
        },
        allowSelection: true,
        tooltipRender: (args: ITooltipEventArgs) => {
            args.content = ['In ' + args.yLabel + ', the ' + args.xLabel + ' produced ' + args.value + ' million barrels per day'];
        },
        dataSource: heatmapData,
    });
    heatmap.appendTo('#container');