Treemap Demo

author(s): Jon Arild Nygård

by Yuriy Bablyukh

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/heatmap.js"></script>
<script src="https://code.highcharts.com/modules/treemap.js"></script>
<div id="container"></div>

CSS

#container {
    min-width: 300px;
    max-width: 600px;
    margin: 0 auto;
}

JavaScript

var data = {
        'South-East Asia': {
            'Sri Lanka': {
                'Communicable & other Group I': '75.5',
                'Injuries': '89.0',
                'Noncommunicable diseases': '501.2'
            },
            'Bangladesh': {
                'Noncommunicable diseases': '548.9',
                'Injuries': '64.0',
                'Communicable & other Group I': '234.6'
            },
            'Myanmar': {
                'Communicable & other Group I': '316.4',
                'Injuries': '102.0',
                'Noncommunicable diseases': '708.7'
            },
            'Maldives': {
                'Injuries': '35.0',
                'Noncommunicable diseases': '487.2',
                'Communicable & other Group I': '59.2'
            },
            'Democratic People\'s Republic of Korea': {
                'Injuries': '91.9',
                'Noncommunicable diseases': '751.4',
                'Communicable & other Group I': '117.3'
            },
            'Bhutan': {
                'Injuries': '142.2',
                'Noncommunicable diseases': '572.8',
                'Communicable & other Group I': '186.9'
            },
            'Thailand': {
                'Injuries': '72.8',
                'Communicable & other Group I': '123.3',
                'Noncommunicable diseases': '449.1'
            },
            'Nepal': {
                'Noncommunicable diseases': '678.1',
                'Injuries': '88.7',
                'Communicable & other Group I': '251.8'
            },
            'Timor-Leste': {
                'Injuries': '69.2',
                'Noncommunicable diseases': '670.5',
                'Communicable & other Group I': '343.5'
            },
            'India': {
                'Communicable & other Group I': '253.0',
                'Injuries': '115.9',
                'Noncommunicable diseases': '682.3'
            },
            'Indonesia': {
                'Injuries': '49.3',
    ...