HighCharts和Map Bubble不兼容

时间:2014-05-12 08:05:15

标签: highcharts

我正在尝试使用Highmaps作为Highcharts源文件(highcharts.js和map.js文件)的集成插件,如“入门”文档页面中所述 - > “加载所需文件”部分。

对于系列类型地图气泡,页面上没有显示任何内容。
请参阅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'
            }
        }]
    });

});

});

提前谢谢!

1 个答案:

答案 0 :(得分:7)

对于将来,我建议使用控制台(开发人员工具),然后您会注意到highcharts会返回#17 error,这意味着highcharts-more.js缺失。

工作示例:http://jsfiddle.net/pvPur/5/