United Kingdom countries - Highmaps

Highmaps demo

by Umair Rafiq

HTML

<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/maps/modules/exporting.js"></script>
<script src="https://code.highcharts.com/mapdata/countries/gb/custom/gb-countries.js"></script>

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

CSS

#container {
    height: 500px; 
    min-width: 310px; 
    max-width: 800px; 
    margin: 0 auto; 
}
.loading {
    margin-top: 10em;
    text-align: center;
    color: gray;
}

JavaScript

// Prepare demo data
// Data is joined to map using value of 'hc-key' property by default.
// See API docs for 'joinBy' for more info on linking data and map.
var data = [
    ['gb-eng', 0],
    ['gb-wls', 1],
    ['gb-sct', -2],
    ['gb-nir', 30]
];

// Create the chart
Highcharts.mapChart('container', {
    chart: {
        map: 'countries/gb/custom/gb-countries'
    },

    title: {
        text: 'Highmaps basic demo'
    },

    subtitle: {
        text: 'Source map: <a href="http://code.highcharts.com/mapdata/countries/gb/custom/gb-countries.js">United Kingdom countries</a>'
    },

    mapNavigation: {
        enabled: true,
        buttonOptions: {
            verticalAlign: 'bottom'
        }
    },

colorAxis: {
                    dataClasses: [{
                        from: -1000,
                        to: 0,
                        color: '#C40401',
                        name: 'Negative'
                    }, {
                        from: 0,
                        to: 1000,
                        color: '#00A000',
                        name: 'Positive'
                    }]
                },
 

    series: [{
        data: data,
        name: 'Random data',
        states: {
            hover: {
                color: '#BADA55'
            }
        },
        dataLabels: {
            enabled: true,
            format: '{point.name}'
        }
    }]
});