this.point.properties是未定义的高映射



我在highmaps中使用自定义映射。我的地图渲染得很好,当我尝试将点绑定到数据时,它就可以工作了。我的问题是我无法读取点属性或将事件附加到任何点。控制台上的错误是this.point.properties未定义。https://jsfiddle.net/mwendakith/0tyfph44/

plotOptions: {
            map: {
            allAreas: false,
            dataLabels: {
                enabled : true,
              formatter: function(){
                if(this.point.properties){
                    return this.point.properties['name'];
                }
              }
            },
          },
      },

我发现在系列定义中可以访问点属性。https://jsfiddle.net/mwendakith/0tyfph44/3/

series: [
    {
        "type": "map",
        "data": data,
        dataLabels: {
                enabled: true,
                color: '#FFFFFF',
                format: '{point.name}'
            },
    }
],

最新更新