HighCharts and Map Bubble are not compatible

2019-09-09 03:25发布

I am trying to use Highmaps as an integrated plugin with Highcharts source file (highcharts.js and map.js files), like described in Getting Started doc page --> section "Load Required files".

For the series type Map Bubble is not displaying nothing on the page.
See jsFiddle:
http://jsfiddle.net/mihaelaCiocoiu/pvPur/3/

<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/maps/modules/map.js"></script>
<script src="http://code.highcharts.com/maps/modules/data.js"></script>
<script src="http://www.highcharts.com/samples/data/maps/us.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>


$(function () {

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

    $('#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'
            }
        },

        series : [{
            name: 'Countries',
            mapData: Highcharts.maps.world,
            color: '#E0E0E0',
            enableMouseTracking: false
        }, {
            type: 'mapbubble',
            mapData: Highcharts.maps.world,
            name: 'Population 2010',
            joinBy: 'code',
            data: data,
            minSize: 4,
            maxSize: '12%',
            tooltip: {
                pointFormat: '{point.code}: {point.z} thousands'
            }
        }]
    });

});

});

Thank you in advance!

标签: highcharts
1条回答
地球回转人心会变
2楼-- · 2019-09-09 04:12

For the future, I advice to use console (developer tools) then you will notice that highcharts returns you #17 error, which means that highcharts-more.js is missing.

Working example: http://jsfiddle.net/pvPur/5/

查看更多
登录 后发表回答