The TreeMap is a widget that displays hierarchical data by using nested rectangles.

Included in: dx.viz.js, dx.viz-web.js, dx.all.js
Module: viz/tree_map
Export: default
TreeMap interactive configuration
Copy Code
Copy to Codepen

In the TreeMap widget, hierarchical data is represented by a set of nested rectangles whose sizes are proportional to the visualized values. TreeMap operates with flat and hierarchical data sources. Also, it can visualize a hierarchy reconstructed from a flat data source.

TreeMap provides three layout algorithms out-of-the-box along with the capability to implement your own algorithm. In addition, the widget includes API methods that enable you to implement the drill down feature. Moreover, TreeMap supports all interactive features available in other DevExtreme Data Visualization Widgets: click, hover and selection.

You can create the TreeMap widget using one of the following approaches.

  • jQuery

    <div id="treeMap"></div>
    var fruitsVegetables = [{
        name: 'Fruits',
        items: [
            { name: 'Apples', value: 4 },
            { name: 'Oranges', value: 10 },
            { name: 'Lemons', value: 6 }
    }, {
        name: 'Vegetables',
        items: [
            { name: 'Cucumbers', value: 4 },
            { name: 'Tomatoes', value: 8 },
            { name: 'Turnips', value: 7 }
    $(function() {
            dataSource: fruitsVegetables
  • AngularJS

    <div ng-controller="DemoController">
        <div dx-tree-map="{
            dataSource: fruitsVegetables
    angular.module('DemoApp', ['dx'])
        .controller("DemoController", function ($scope) {
            $scope.fruitsVegetables = [
                // ...   
  • Knockout

    <div data-bind="dxTreeMap: {
        dataSource: fruitsVegetables
    var viewModel = {
        fruitsVegetables: [
            // ...
  • ASP.NET MVC Wrappers


Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

View Demo Watch Video

See Also


This section describes properties that configure the contents, behavior and appearance of the TreeMap widget.


This section describes methods that can be called to manipulate the TreeMap widget.


This section describes events fired by this widget.


This section describes fields and methods that can be used in code to manipulate a Node object.

Node objects are accessible within certain event handlers, for example, onNodesInitialized, onNodesRendering, etc. Also, you can obtain these objects using the getRootNode() and getCurrentNode() methods.