Search results

Legend in Vue TreeMap component

Legend is used to provide valuable information for interpreting what the tree map is displaying and can be represented in various colors, shapes or other identifiers based on data.

Position and alignment

Legend position is used to place legend in various positions. Based on the legend position, the legend item will be aligned. For example, if the position is top or bottom, the legend items are placed by rows. If the position is left or right, the legend items are placed by columns.

The following options are available to customize the legend position:

  • Top
  • Bottom
  • Left
  • Right
  • Float

The following code example shows the legend position.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :rangeColorValuePath= 'rangeColorValuePath' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [
                       { fruit:'Apple', count:5000 },
                       { fruit:'Mango', count:3000 },
                       { fruit:'Orange', count:2300 },
                       { fruit:'Banana', count:500 },
                       { fruit:'Grape', count:4300 },
                       { fruit:'Papaya', count:1200 },
                       { fruit:'Melon', count:4500 }
    ],
   weightValuePath: 'count',
    rangeColorValuePath:'count',
    legendSettings: {
        visible: true,
        position: 'Top'
    },
    leafItemSettings: {
        labelPath: 'fruit',
        colorMapping:[
            {
               from:500,
               to:3000,
               color:'orange'
           },
           {
               from:3000,
               to:5000,
               color:'green'
           }
        ]
     }
    }
  },
  provide:{
    treemap:[TreeMapLegend]
},
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Legend Alignment is used to align the legend items in specific location. The following options are available to customize the legend alignment:

  • Near
  • Center
  • Far

The following code example shows legend alignment.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :rangeColorValuePath='rangeColorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
    height:'350px',
     dataSource: [
        { fruit:'Apple', count:5000 },
                       { fruit:'Mango', count:3000 },
                       { fruit:'Orange', count:2300 },
                       { fruit:'Banana', count:500 },
                       { fruit:'Grape', count:4300 },
                       { fruit:'Papaya', count:1200 },
                       { fruit:'Melon', count:4500 }
    ],
   weightValuePath: 'count',
    rangeColorValuePath:'count',
    legendSettings: {
       visible: true,
       alignment:'Far',
    },
    leafItemSettings: {
        labelPath: 'fruit',
        colorMapping:[
            {
               from:500,
               to:3000,
               color:'orange'
           },
           {
               from:3000,
               to:5000,
               color:'green'
           }
        ]
     }
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Legend mode

The tree map control supports two different types of legend rendering modes such as Default and Interactive.

Default mode

In default mode, legends have symbols with legend labels that are used to identify the items in tree map control.

The following code example shows the default mode of legends.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :equalColorValuePath='equalColorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [{ Car:'Mustang', Brand:'Ford', count:232 },
                       { Car:'EcoSport', Brand:'Ford', count:121 },
                       { Car:'Swift', Brand:'Maruti', count:143 },
                       { Car:'Baleno', Brand:'Maruti', count:454 },
                       { Car:'Vitara Brezza', Brand:'Maruti', count:545 },
                       { Car:'A3 Cabriolet', Brand:'Audi',count:123 },
                       { Car:'RS7 Sportback', Brand:'Audi', count:523 }
    ],
   weightValuePath: 'count',
    equalColorValuePath:'Brand',
    legendSettings: {
        visible: true,
        position:'Top',
        border:{color:'black',width:2}
    },
    leafItemSettings: {
        labelPath: 'Car',
        colorMapping:[
            {
               value:'Ford',
               color:'green'
           },
           {
               value:'Audi',
               color:'red'
           },
           {
               value:'Maruti',
               color:'orange'
           }
        ]
     }
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Interactive mode

The legends can be made interactive with an arrow mark that indicates exact range color in legend when the mouse hovers over the corresponding shape. You can enable this option by setting the mode property in legendSettings value to “Interactive”. The default value of the mode property is “Default” to enable normal legend.

The following code example shows the interactive mode of legends.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :equalColorValuePath='equalColorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [{ Car:'Mustang', Brand:'Ford', count:232 },
                       { Car:'EcoSport', Brand:'Ford', count:121 },
                       { Car:'Swift', Brand:'Maruti', count:143 },
                       { Car:'Baleno', Brand:'Maruti', count:454 },
                       { Car:'Vitara Brezza', Brand:'Maruti', count:545 },
                       { Car:'A3 Cabriolet', Brand:'Audi',count:123 },
                       { Car:'RS7 Sportback', Brand:'Audi', count:523 }
    ],
   weightValuePath: 'count',
    equalColorValuePath:'Brand',
    legendSettings: {
        visible: true,
        mode:'Interactive',
        position:'Top',
        border:{color:'black',width:2}
    },
    leafItemSettings: {
        labelPath: 'Car',
        colorMapping:[
            {
               value:'Ford',
               color:'green'
           },
           {
               value:'Audi',
               color:'red'
           },
           {
               value:'Maruti',
               color:'orange'
           }
        ]
     }
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Legend size

You can customize the legend size by modifying the [height] and [width] properties in the legendSettings. It accepts values in both percentage and pixel. If the value is specified in percentage for height or width, the legend height will be calculated for overall height.

Legend size is shown in the following example.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :equalColorValuePath='equalColorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [{ Car:'Mustang', Brand:'Ford', count:232 },
                       { Car:'EcoSport', Brand:'Ford', count:121 },
                       { Car:'Swift', Brand:'Maruti', count:143 },
                       { Car:'Baleno', Brand:'Maruti', count:454 },
                       { Car:'Vitara Brezza', Brand:'Maruti', count:545 },
                       { Car:'A3 Cabriolet', Brand:'Audi',count:123 },
                       { car:'RS7 Sportback', Brand:'Audi', count:523 }
    ],
   weightValuePath: 'count',
    equalColorValuePath:'Brand',
    legendSettings: {
        visible: true,
        height:'50px',
        width:'200px',
        position:'Top',
        border:{color:'black',width:2}
    },
    leafItemSettings: {
        labelPath: 'Car',
        colorMapping:[
            {
               value:'Ford',
               color:'green'
           },
           {
               value:'Audi',
               color:'red'
           },
           {
               value:'Maruti',
               color:'orange'
           }
        ]
     }
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Paging support

The tree map supports the legend paging. Legend paging will be enabled if the legend items cannot placed within provided height and width.

The following code example shows enabling legend paging.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :equalColorValuePath='equalColorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [{ Car:'Mustang', Brand:'Ford', count:232 },
                       { Car:'EcoSport', Brand:'Ford', count:121 },
                       { Car:'Swift', Brand:'Maruti', count:143 },
                       { Car:'Baleno', Brand:'Maruti', count:454 },
                       { Car:'Vitara Brezza', Brand:'Maruti', count:545 },
                       { Car:'A3 Cabriolet', Brand:'Audi',count:123 },
                       { car:'RS7 Sportback', Brand:'Audi', count:523 }
    ],
   weightValuePath: 'count',
    equalColorValuePath:'Brand',
    legendSettings: {
        visible: true,
        height:'50px',
        width:'100px',
        border:{color:'black',width:2}
    },
    leafItemSettings: {
        labelPath: 'Car',
        colorMapping:[
            {
               value:'Ford',
               color:'green'
           },
           {
               value:'Audi',
               color:'red'
           },
           {
               value:'Maruti',
               color:'orange'
           }
        ]
     },
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Legend for items excluded from color mapping

Based on the ranges in the data source, get the excluded ranges from color mapping, and then show the legend with excluded range values are bound to the specific legend.

The following code example shows how to set the color for items excluded from color mapping.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :rangeColorValuePath='rangeColorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [{ fruit:'Apple', count:5000 },
                       { fruit:'Mango', count:3000 },
                       { fruit:'Orange', count:2300 },
                       { fruit:'Banana', count:500 },
                       { fruit:'Grape', count:4300 },
                       { fruit:'Papaya', count:1200 },
                       { fruit:'Melon', count:4500 }
    ],
   weightValuePath: 'count',
    rangeColorValuePath:'count',
    legendSettings: {
        visible: true
    },
    leafItemSettings: {
        labelPath: 'fruit',
        colorMapping:[
            {
               from: 500,
               to: 2500,
               color:'green'
           },
           {
               from: 3000,
               to: 4000,
               color:'red'
           },
           {
               color:'orange'
           }
        ]
     }
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Hide desired legend items

To enable or disable the desired legend for each color mapping,set the showLegend property to true in colorMapping.

The following code example shows to hide the desired legend.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :rangeColorValuePath='rangeColorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [{ fruit:'Apple', count:5000 },
                       { fruit:'Mango', count:3000 },
                       { fruit:'Orange', count:2300 },
                       { fruit:'Banana', count:500 },
                       { fruit:'Grape', count:4300 },
                       { fruit:'Papaya', count:1200 },
                       { fruit:'Melon', count:4500 }
    ],
   weightValuePath: 'count',
    rangeColorValuePath:'count',
    legendSettings: {
        visible: true
    },
    leafItemSettings: {
        labelPath: 'fruit',
        colorMapping:[
            {
               from: 500,
               to: 2500,
               color:'green',
               showLegend: false,
           },
           {
               from: 3000,
               to: 4000,
               color:'red'
               showLegend: true,
           },
           {
               color:'orange',
               showLegend: true,
           }
        ]
     }
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Hide legend items based data source value

To enable or disable the legend visibility for each item, bind the field name in the data source to the showLegendPath property in legendSettings.

The following code example shows how to hide legend items based on data source value.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :colorValuePath='colorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :palette='palette' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [{ fruit:'Apple', count:5000, visibility: true , color: 'red'},
                       { fruit:'Mango', count:3000, visibility: false, color:'blue'},
                       { fruit:'Orange', count:2300, visibility: true, color:'green' },
                       { fruit:'Banana', count:500, visibility: false, color:'yellow' },
                       { fruit:'Grape', count:4300, visibility: true, color:'orange' },
                       { fruit:'Papaya', count:1200, visibility: false, color:'pink' },
                       { fruit:'Melon', count:4500, visibility: true , color:'violet'}
    ],
    weightValuePath: 'count',
    colorValuePath:'color',
    palette:[],
    legendSettings: {
        visible: true,
        showLegendPath:'visibility'
    },
    leafItemSettings: {
        labelPath: 'fruit',
     }
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Bind legend item text from data source

To show the legend text based on binding, the field name in the datasource should be set to the valuePath property in legendSettings.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :colorValuePath='colorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :palette='palette' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [{ fruit:'Apple', count:5000, visibility: true , color: 'red'},
                       { fruit:'Mango', count:3000, visibility: false, color:'blue'},
                       { fruit:'Orange', count:2300, visibility: true, color:'green' },
                       { fruit:'Banana', count:500, visibility: false, color:'yellow' },
                       { fruit:'Grape', count:4300, visibility: true, color:'orange' },
                       { fruit:'Papaya', count:1200, visibility: false, color:'pink' },
                       { fruit:'Melon', count:4500, visibility: true , color:'violet'}
    ],
    weightValuePath: 'count',
    colorValuePath:'color',
    palette:[],
    legendSettings: {
        visible: true,
        valuePath:'fruit'
    },
    leafItemSettings: {
        labelPath: 'fruit',
     }
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Hide duplicate legend items

To enable or disable the duplicate legend items, set the removeDuplicateLegend property to true in legendSettings.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :colorValuePath='colorValuePath' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :palette='palette' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from 'vue';
import { TreeMapPlugin, TreeMapLegend } from "@syncfusion/ej2-vue-treemap";
Vue.use(TreeMapPlugin);

export default {
  data: function() {
    return {
     dataSource: [{ fruit:'Apple', count:5000, visibility: true , color: 'red'},
                       { fruit:'Mango', count:3000, visibility: false, color:'blue'},
                       { fruit:'Orange', count:2300, visibility: true, color:'green' },
                       { fruit:'Banana', count:500, visibility: false, color:'yellow' },
                       { fruit:'Grape', count:4300, visibility: true, color:'orange' },
                       { fruit:'Mango', count:1200, visibility: false, color:'pink' },
                       { fruit:'Banana', count:4500, visibility: true , color:'violet'}
    ],
    weightValuePath: 'count',
    colorValuePath:'color',
    palette:[],
    legendSettings: {
        visible: true,
        valuePath:'fruit',
        removeDuplicateLegend: true
    },
    leafItemSettings: {
        labelPath: 'fruit',
     }
    }
  },
   provide:{
    treemap:[TreeMapLegend]
    },
}
</script>
export var data = [
    {
        Continent: [
            {
                Name: "Africa", Population: 1216130000, States: [
                    {
                        Name: "Eastern Africa", Population: 410637987, Region: [
                            { Name: "Ethiopia", Population: 107534882 },
                            { Name: "Tanzania", Population: 59091392 },
                            { Name: "Kenya", Population: 50950879 },
                            { Name: "Uganda", Population: 44270563 },
                            { Name: "Mozambique", Population: 30528673 },
                            { Name: "Madagascar", Population: 26262810 },
                            { Name: "Malawi", Population: 19164728 },
                            { Name: "Zambia", Population: 17609178 },
                            { Name: "Zimbabwe", Population: 16913261 },
                            { Name: "Somalia", Population: 15181925 },
                            { Name: "South, Sudan", Population: 12919053 },
                            { Name: "Rwanda", Population: 12501156 },
                            { Name: "Burundi", Population: 11216450 },
                            { Name: "Eritrea", Population: 5187948 },
                            { Name: "Mauritius", Population: 1268315 },
                            { Name: "Djibouti", Population: 971408 },
                            { Name: "Réunion", Population: 883247 },
                            { Name: "Comoros", Population: 832347 },
                            { Name: "Mayotte", Population: 259682 },
                            { Name: "Seychelles", Population: 95235 },
                        ]
                    },
                    {
                        Name: "Middle Africa", Population: 158562976, Region: [
                            { Name: "Democratic, Republic of the Congo", Population: 84004989 },
                            { Name: "Angola", Population: 30774205 },
                            { Name: "Cameroon", Population: 24678234 },
                            { Name: "Chad", Population: 15353184 },
                            { Name: "Congo", Population: 5399895 },
                            { Name: "Central African, Republic", Population: 4737423 },
                            { Name: "Gabon", Population: 2067561 },
                            { Name: "Equatorial Guinea", Population: 1313894 },
                            { Name: "Sao Tome and Principe", Population: 208818 },
                        ]
                    },
                    {
                        Name: "Northern Africa", Population: 229385603, Region: [
                            { Name: "Egypt", Population: 99375741 },
                            { Name: "Algeria", Population: 42008054 },
                            { Name: "Sudan", Population: 41511526 },
                            { Name: "Morocco", Population: 36191805 },
                            { Name: "Tunisia", Population: 11659174 },
                            { Name: "Libya", Population: 6470956 },
                            { Name: "Western, Sahara", Population: 567421 },
                        ]
                    },
                    {
                        Name: "Southern Africa", Population: 64292365, Region: [
                            { Name: "South Africa", Population: 57398421 },
                            { Name: "Namibia", Population: 2587801 },
                            { Name: "Botswana", Population: 2333201 },
                            { Name: "Lesotho", Population: 2263010 },
                            { Name: "Swaziland", Population: 1391385 },
                        ]
                    },
                    {
                        Name: "Western Africa", Population: 362201579, Region: [
                            { Name: "Nigeria", Population: 195875237 },
                            { Name: "Ghana", Population: 29463643 },
                            { Name: "Côte d'Ivoire", Population: 24905843 },
                            { Name: "Niger", Population: 22311375 },
                            { Name: "Burkina Faso", Population: 19751651 },
                            { Name: "Mali", Population: 19107706 },
                            { Name: "Senegal", Population: 16294270 },
                            { Name: "Guinea", Population: 13052608 },
                            { Name: "Benin", Population: 11485674 },
                            { Name: "Togo", Population: 7990926 },
                            { Name: "Sierra Leone", Population: 7719729 },
                            { Name: "Liberia", Population: 4853516 },
                            { Name: "Mauritania", Population: 4540068 },
                            { Name: "Gambia", Population: 2163765 },
                            { Name: "Guinea-Bissau", Population: 1907268 },
                            { Name: "Cabo Verde", Population: 553335 },
                            { Name: "Saint Helena", Population: 4074 },
                        ]
                    },
                ]
            }]
    },



    {
        Continent: [
            {
                Name: "Asia", Population: 4436224000, States: [
                    {
                        Name: "Central Asia", Population: 69787760, Region: [
                            { Name: "Uzbekistan", Population: 32364996 },
                            { Name: "Kazakhstan", Population: 18403860 },
                            { Name: "Tajikistan", Population: 9107211 },
                            { Name: "Kyrgyzstan", Population: 6132932 },
                            { Name: "Turkmenistan", Population: 5851466 },
                        ]
                    },
                    {
                        Name: "Eastern Asia", Population: 1641908531, Region: [
                            { Name: "China", Population: 1415045928 },
                            { Name: "Japan", Population: 127185332 },
                            { Name: "South Korea", Population: 51164435 },
                            { Name: "North Korea", Population: 25610672 },
                            { Name: "Taiwan", Population: 23694089 },
                            { Name: "Hong Kong", Population: 7428887 },
                            { Name: "Mongolia", Population: 3121772 },
                            { Name: "Macao", Population: 632418 },
                        ]
                    },
                    {
                        Name: "Southeastern Asia", Population: 641775797, Region: [
                            { Name: "Indonesia", Population: 266794980 },
                            { Name: "Philippines", Population: 106512074 },
                            { Name: "Viet Nam", Population: 96491146 },
                            { Name: "Thailand", Population: 69183173 },
                            { Name: "Myanmar", Population: 53855735 },
                            { Name: "Malaysia", Population: 32042458 },
                            { Name: "Cambodia", Population: 16245729 },
                            { Name: "Laos", Population: 6961210 },
                            { Name: "Singapore", Population: 5791901 },
                            { Name: "Timor-Leste", Population: 1324094 },
                            { Name: "Brunei Darussalam", Population: 434076 },
                        ]
                    },
                    {
                        Name: "Southern Asia", Population: 1846266634, Region: [
                            { Name: "India", Population: 1354051854 },
                            { Name: "Pakistan", Population: 200813818 },
                            { Name: "Bangladesh", Population: 166368149 },
                            { Name: "Iran", Population: 82011735 },
                            { Name: "Afghanistan", Population: 36373176 },
                            { Name: "Nepal", Population: 29624035 },
                            { Name: "Sri Lanka", Population: 20950041 },
                            { Name: "Bhutan", Population: 817054 },
                            { Name: "Maldives", Population: 444259 },
                        ]
                    },
                    {
                        Name: "Western Asia", Population: 262938009, Region: [
                            { Name: "Turkey", Population: 81916871 },
                            { Name: "Iraq", Population: 39339753 },
                            { Name: "Saudi Arabia", Population: 33554343 },
                            { Name: "Yemen", Population: 28915284 },
                            { Name: "Syria", Population: 18284407 },
                            { Name: "Azerbaijan", Population: 9923914 },
                            { Name: "Jordan", Population: 9903802 },
                            { Name: "United Arab Emirates", Population: 9541615 },
                            { Name: "Israel", Population: 8452841 },
                            { Name: "Lebanon", Population: 6093509 },
                            { Name: "State of Palestine", Population: 5052776 },
                            { Name: "Oman", Population: 4829946 },
                            { Name: "Kuwait", Population: 4197128 },
                            { Name: "Georgia", Population: 3907131 },
                            { Name: "Armenia", Population: 2934152 },
                            { Name: "Qatar", Population: 2694849 },
                            { Name: "Bahrain", Population: 1566993 },
                            { Name: "Cyprus", Population: 1189085 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "North America", Population: 579024000, States: [

                    {
                        Name: "Central America", Population: 174988756, Region: [
                            { Name: "Mexico", Population: 130759074 },
                            { Name: "Guatemala", Population: 17245346 },
                            { Name: "Honduras", Population: 9417167 },
                            { Name: "El, Salvador", Population: 6411558 },
                            { Name: "Nicaragua", Population: 6284757 },
                            { Name: "Costa, Rica", Population: 4953199 },
                            { Name: "Panama", Population: 4162618 },
                            { Name: "Belize", Population: 382444 },
                        ]
                    },
                    {
                        Name: "Northern America", Population: 358593810, Region: [
                            { Name: "U.S.", Population: 3267667480 },
                            { Name: "Canada", Population: 36953765 },
                            { Name: "Bermuda", Population: 61070 },
                            { Name: "Greenland", Population: 56565 },
                            { Name: "Saint Pierre & Miquelon", Population: 6342 },
                        ]
                    },
                ]
            }]
    },


    {
        Continent: [
            {
                Name: "South America", Population: 422535000, States: [
                    { Name: "Brazil", Population: 204519000 },
                    { Name: "Colombia", Population: 48549000 },
                    { Name: "Argentina", Population: 43132000 },
                    { Name: "Peru", Population: 31153000 },
                    { Name: "Venezuela", Population: 30620000 },
                    { Name: "Chile", Population: 18006000 },
                    { Name: "Ecuador", Population: 16279000 },
                    { Name: "Bolivia", Population: 10520000 },
                    { Name: "Paraguay", Population: 7003000 },
                    { Name: "Uruguay", Population: 3310000 },
                    { Name: "Guyana", Population: 747000 },
                    { Name: "Suriname", Population: 560000 },
                    { Name: "French Guiana", Population: 262000 },
                    { Name: "Falkland Islands", Population: 3000 },
                ]
            },
        ]
    },


    {
        Continent: [
            {
                Name: "Europe", Population: 738849000, States: [
                    {
                        Name: "Eastern Europe", Population: 291953328, Region: [
                            { Name: "Russia", Population: 143964709 },
                            { Name: "Ukraine", Population: 44009214 },
                            { Name: "Poland", Population: 38104832 },
                            { Name: "Romania", Population: 19580634 },
                            { Name: "Crech, Republic", Population: 10625250 },
                            { Name: "Hungary", Population: 9688847 },
                            { Name: "Belarus", Population: 9452113 },
                            { Name: "Bulgaria", Population: 7036848 },
                            { Name: "Slovakia", Population: 5449816 },
                            { Name: "Moldova", Population: 4041065 },
                        ]
                    },
                    {
                        Name: "Northern Europe", Population: 103642971, Region: [
                            { Name: "United Kingdom", Population: 66573504 },
                            { Name: "Sweden", Population: 9982709 },
                            { Name: "Denmark", Population: 5754356 },
                            { Name: "Finland", Population: 5542517 },
                            { Name: "Norway", Population: 5353363 },
                            { Name: "Ireland", Population: 4803748 },
                            { Name: "Lithuania", Population: 2876475 },
                            { Name: "Latvia", Population: 1929938 },
                            { Name: "Estonia", Population: 1306788 },
                            { Name: "Iceland", Population: 337780 },
                            { Name: "Channel Islands", Population: 166083 },
                            { Name: "Isle of Man", Population: 84831 },
                            { Name: "Faeroe Islands", Population: 49489 },
                        ]
                    },
                    {
                        Name: "Southern Europe", Population: 152172107, Region: [
                            { Name: "Italy", Population: 59290969 },
                            { Name: "Spain", Population: 46397452 },
                            { Name: "Greece", Population: 11142161 },
                            { Name: "Portugal", Population: 10291196 },
                            { Name: "Serbia", Population: 8762027 },
                            { Name: "Croatia", Population: 4164783 },
                            { Name: "Bosnia and Herzegovina", Population: 3503554 },
                            { Name: "Albania", Population: 2934363 },
                            { Name: "Macedonia", Population: 2085051 },
                            { Name: "Slovenia", Population: 2081260 },
                            { Name: "Montenegro", Population: 629219 },
                            { Name: "Malta", Population: 432089 },
                            { Name: "Andorra", Population: 76953 },
                            { Name: "Gibraltar", Population: 34733 },
                            { Name: "San Marino", Population: 33557 },
                            { Name: "Holy, See", Population: 801 },
                        ]
                    },
                    {
                        Name: "Western Europe", Population: 92746859, Region: [
                            { Name: "Germany", Population: 82293457 },
                            { Name: "France", Population: 65233271 },
                            { Name: "Netherlands", Population: 17084459 },
                            { Name: "Belgium", Population: 11498519 },
                            { Name: "Austria", Population: 8751820 },
                            { Name: "Switzerland", Population: 8544034 },
                            { Name: "Luxembourg", Population: 590321 },
                            { Name: "Monaco", Population: 38897 },
                            { Name: "Liechtenstein", Population: 38155 },
                        ]
                    },
                ]
            }]
    }
]

Legend Responsiveness

Use a responsive legend that switches positions between the right and bottom based on the available height and width. To enable the responsive legend, set the position property to auto in the legendSettings API, and the legend position is changed based on available height and width.

In the following sample, the responsive legend is shown.

Source
Preview
app.vue
datasource.js
<template>
    <div class="control_wrapper">
        <ejs-treemap id="treemap"  :dataSource='dataSource' :legendSettings='legendSettings' :weightValuePath='weightValuePath' :palette='palette' :leafItemSettings='leafItemSettings'></ejs-treemap>
    </div>
</template>
<script>
import Vue from