Highcharts Demo

author(s): Torstein Hønsi

HTML

<script src="http://github.highcharts.com/highmaps.js"></script>
<script src="http://code.highcharts.com/maps/modules/data.js"></script>
<script src="http://code.highcharts.com/mapdata/custom/world.js"></script>
<div id="container" style="height: 500px; min-width: 310px; max-width: 800px; margin: 0 auto"></div>

JavaScript

$(function () {

    $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=world-population.json&callback=?', function (data) {

        var mapData = Highcharts.geojson(Highcharts.maps['custom/world']);

        // Correct UK to GB in data
        $.each(data, function () {
            if (this.code === 'UK') {
                this.code = 'GB';
            }
        });

        $('#container').highcharts('Map', {
            chart: {
                borderWidth: 1
            },

            title: {
                text: 'World population 2010 by country'
            },

            subtitle: {
                text: 'Demo of Highcharts map with bubbles'
            },

            legend: {
                enabled: false
            },

            mapNavigation: {
                enabled: true,
                buttonOptions: {
                    verticalAlign: 'bottom'
                }
            },
            plotOptions: {
                series: {
                    marker: {
                        states: {
                            hover: {
                                lineWidth: 30
                            }
                        }
                    }
                }
            },
            series: [{
                name: 'Countries',
                mapData: mapData,
                color: '#E0E0E0',
                enableMouseTracking: false
            }, {
                type: 'mapbubble',
                mapData: mapData,
                name: 'Population 2010',
                joinBy: ['iso-a2', 'code'],
                
                data: [{
                    color: '#ff0000',
                    code: 'AF',
                    z: 31412
                },{
                    color:'#ff00ff',
                    code: 'AU',
                    z: 15040
                }],
                minSize: 4,
                maxSize: '12%',
                tooltip: {
                    pointFormat:...