Treemap Demo

author(s): Jon Arild Nygård

by stuarthwoods

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

$(function () {
		Highcharts.setOptions({
    		colors: ['#A0D9FF','#0F487F','#7CB5EC','#346DA4','#5891C8',],
				credits: { enabled: false }}); 
    var data = {
            '1 Star': {
                'Hungary': {
                    'Communicable & other Group I': '16.8',
                    'Noncommunicable diseases': '602.8',
                    'Injuries': '44.3'
                },
                'Poland': {
                    'Communicable & other Group I': '22.6',
                    'Noncommunicable diseases': '494.5',
                    'Injuries': '48.9'
                },
                'Israel': {
                    'Communicable & other Group I': '31.2',
                    'Noncommunicable diseases': '311.2',
                    'Injuries': '20.8'
                },
                'France': {
                    'Communicable & other Group I': '21.4',
                    'Noncommunicable diseases': '313.2',
                    'Injuries': '34.6'
                },
                'Turkey': {
                    'Injuries': '39.1',
                    'Communicable & other Group I': '43.9',
                    'Noncommunicable diseases': '555.2'
                },
                'Kyrgyzstan': {
                    'Communicable & other Group I': '65.8',
                    'Injuries': '65.1',
                    'Noncommunicable diseases': '835.4'
                },
                'Croatia': {
                    'Communicable & other Group I': '12.2',
                    'Noncommunicable diseases': '495.8',
                    'Injuries': '40.1'
                },
                'Portugal': {
                    'Injuries': '25.2',
                    'Communicable & other Group I': '39.9',
                    'Noncommunicable diseases': '343.3'
                },
                'Greece': {
                    'Injuries': '26.5',
                    'Noncommunicable diseases': '365.0',
                    'Communicable & other Group I':...