You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/04/20 10:13:24 UTC

[GitHub] [echarts] ItsMisa commented on issue #14720: echart使用全球地图为区域增加hover tooltip,未展示提示框并且 hvoer的时候 报错:TooltipView.js?42f6:473 Uncaught TypeError: Cannot read property 'getData' of undefined

ItsMisa commented on issue #14720:
URL: https://github.com/apache/echarts/issues/14720#issuecomment-823156709


   安装了5.1.0最新版本还是会报错。这是我的代码
    echarts.registerMap('world', mapJSON);
           let myChart = echarts.init(this.$refs.echarts)
           myChart.setOption({
               title: {
                   text: this.title,
                   subText:this.subText
                },
               tooltip: {
                   trigger: 'item',
                   formatter: function(params) {
                       console.log(params)
                       // if ('value' in params.data) {
                       //     return params.data.value[2] + ': ' + params.data.value[0];
                       // }
                   }
               },
               visualMap: {
                   min: 800,
                   max: 50000,
                   left: 'left',
                   top: 'bottom',
                   text: ['高', '低'],
                   dimension: 0,
                   inRange: {
                   color: ['lightskyblue', 'yellow', 'orangered']
                   },
                   calculable: false
               },
               series: [
                   {
                       name: '全球地区客户分布',
                       type: 'map',
                       id: 'map',
                       map: 'world', // 自定义扩展图表类型
                       // roam: true,
                       nameMap,
                       data:regionData,
                       label:{
                           fontWeight:500,
                           fontSize:16
                       },
                       itemStyle: {
                       },
                      
                   },
               ]
           })


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org