-1

http://jsfiddle.net/pkb9ovLa/

我正在为美国创建一个 HighMap。当我运行我的代码时,我没有得到任何输出。为什么是这样?

$(函数(){

        $.getJSON('http://localhost:52149/Scripts/BrokerInfo.json', function (data) {
         $('#container').highcharts('Map', {

        chart : {
            borderWidth : 1
        },

        title : {
            text : 'Broker Zonal Assignment'
        },
        mapNavigation: {
            enabled: true
        },

                series : [{
            animation: {
                duration: 1000
            },
            data : data,
            mapData: Highcharts.maps['countries/us/us-all'],
            joinBy: ['State', 'State'],
            dataLabels: {
                enabled: true,
                color: 'white',
                format: '{point.State}'
            },
            name: 'Vice President',
            tooltip: {
                pointFormat: '{point.state}: {point.VicePresident}'
            }
        }]
    });
});
4

1 回答 1

1

Uncaught ReferenceError: Highcharts is not defined

顺序不对,在加载主文件之前不能加载highcharts的依赖。

<script type="text/javascript" src="http://code.highcharts.com/mapdata/countries/us/us-all-all.js"></script>

需要在highmaps.js包含之后

于 2015-01-29T15:29:00.807 回答