在Ionic的Highmap中获取运行时错误

时间:2019-01-28 10:11:22

标签: highcharts

  1. 添加插件“ angular2-highcharts”
  2. 添加高图代码

ERROR

1 个答案:

答案 0 :(得分:0)

Please use this code

 ionViewDidLoad() {
    var chart = Highcharts.mapChart('container', {
      chart: {
        map: 'custom/europe',
        spacingBottom: 20
      },

    title: {
       text: 'Europe time zones'
     },

    legend: {
       enabled: true
    },

    plotOptions: {
      map: {
        allAreas: false,
        dataLabels: {
          enabled: true,
          color: '#FFFFFF',
          style: {
          fontWeight: 'bold'
          },
      // Only show dataLabels for areas with high label rank
       format: null,
       formatter: function () {
        if (this.point.properties && this.point.properties.labelrank.toString() < 5) {
            return this.point.properties['iso-a2'];
        }
    }
        },
        tooltip: {
          headerFormat: '',
          pointFormat: '{point.name}: <b>{series.name}</b>'
      }
      }
    },


    })
    }