javascript - 类型错误 : a is undefined Highmaps

标签 javascript highcharts highmaps

我正在尝试创建 Highcharts ,但收到此错误:

TypeError: a is undefined           highmaps.js:11:348

这似乎是 javaScript 库(highmaps)加载问题,但我无法解决。

我们如何解决这个问题?

这是我的代码:

$('#container').highcharts('Map', {

        title : {
            text : ''
        },

        subtitle : {
            text : ''
        },

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

        credits:false,

        colorAxis: {
                min: 0,
                minColor: '#ffb899',
                stops: [
                    [0, '#ff9966'],
                    [0.67, '#c9433f'],
                    [1, '#7e3045']
                ]
        },
        series : [{
         data : [{
                    "hc-key": "tr-aa",
                    "value": 190.00,
                    "indikator_id":138,
                    "indikator_id":138,
                    "donem":"2015-4.Dönem",
                    "city":1
               }],
            mapData: Highcharts.maps['countries/tr/tr-all'],
            joinBy: 'hc-key',
            name: 'İndikatör Toplam Değeri',
            point:{
                events:{
                    click:function(){

                        $('div#mapModal').modal();

                        $.ajax({
                            type:'POST',
                            url:'ajax/map_data_ajax.php',
                            data:this.options,
                            success:function(res){
                                $('div#mapData').html(res);

                                console.log(res);

                            }
                        });
                    }
                }
            },
            borderColor: '#fff',
            borderWidth: 1.2,
            states: {
                hover: {
                    color: '#0086ff'
                }
            },
            dataLabels: {
                enabled: true,
                format: '{point.name}',
                color:'#fff'
            }
        }]
    });

这里是jsfiddle .

您将在 fiddle 上看到此错误:

Uncaught TypeError: Cannot read property 'indexOf' of undefined

我们如何解决这个问题?

谢谢

最佳答案

我犯了一个简单的错误。通常不存在任何关于 javascript 加载的错误。 错误与学分有关。

这不是credits:false。它会像这样:

credits:{
   enabled:false
}

现在可以运行了:jsfiddle

无论如何,谢谢。

关于javascript - 类型错误 : a is undefined Highmaps,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35311387/

相关文章:

javascript - jQuery 日期选择器功能

javascript - 显示/隐藏 Highchart 内容

javascript - 为什么没有数据的国家总是名列前茅?

javascript - 如何获取多个highchart容器中图表的索引

javascript - TypeError : $(. ..).SetHeight 不是函数

javascript - GoogleMap Api - 初始化()

javascript - 在jquery中获取当前点击的项目值

javascript - 更改 PHP 变量后 Highcharts 实时数据未更新

javascript - Highcharts 仅指定绘图区域的高度

javascript - 如何在 Meteor 中使用 Highmaps 和 Highcharts?