Highcharts Demo

author(s): Mustapha Mekhatria

by dandiebolt

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/tilemap.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

<div id="container"></div>

CSS

#container {
	min-width: 420px;
	max-width: 650px;
	margin: 0 auto;
}

JavaScript

//http://klingonska.org/ref/time.html#week

Highcharts.chart('container', {
    chart: {
        type: 'tilemap',
        inverted: true,
        height: '80%'
    },

    title: {
        text: 'U.S. states by population in 2016'
    },

    subtitle: {
        text: 'Source:<a href="https://simple.wikipedia.org/wiki/List_of_U.S._states_by_population">Wikipedia</a>'
    },

    xAxis: {
        visible: false
    },

    yAxis: {
        visible: false
    },

    colorAxis: {
        dataClasses: [{
            from: 0,
            to: 1000000,
            color: '#F9EDB3',
            name: '< 1M'
        }, {
            from: 1000000,
            to: 5000000,
            color: '#FFC428',
            name: '1M - 5M'
        }, {
            from: 5000000,
            to: 20000000,
            color: '#FF7987',
            name: '5M - 20M'
        }, {
            from: 20000000,
            color: '#FF2371',
            name: '> 20M'
        }]
    },

    tooltip: {
        headerFormat: '',
        pointFormat: 'The population of <b> {point.name}</b> is <b>{point.value}</b>'
    },

    plotOptions: {
        series: {
            dataLabels: {
                enabled: true,
                format: '<i>{point.dow}</i><br>{point.date}',
                color: '#000000',
                style: {
                    textOutline: false
                }
            }
        }
    },

    series: [{
        name: '',
        data: [{
            'dow': 'wa’',
            name: 'Alabama',
            date: "1",
            region: 'South',
            x: 0,
            y: 0,
            value: 4849377
        }, {
            'dow': 'DaS',
            name: 'Alaska',
            region: 'West',
            x: 0,
            y: 1,
            value: 737732
        }, {
            'dow': 'pov',
            name: 'Arizona',
            region: 'West',
            x: 0,
            y: 2,
            value: 6745408
        }, {
            'dow': 'ghItlh',
        ...