evetveve opened a new issue #8138: map tooltip, label formatter issue
URL: https://github.com/apache/incubator-echarts/issues/8138
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   For example, 7 regions in the map.
   series map data 3 regions.
   label formatter Only 3 local events and 4 other events do not occur. 
(this.context)
   tooltip The tooltip that has all the formatter events but no series map data 
has a name value null.
   In echarts3 version, name & value null name is geo name and value is 0
   
   
![image](https://user-images.githubusercontent.com/38307787/38656840-0c43ecd4-3e58-11e8-96b4-427e8d8fce2c.png)
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]: 4.0.4
   + Browser version [浏览器类型和版本]: chrome 65.0.3325.181
   + OS Version [操作系统类型和版本]: window 10
   
   
   
   
   
   ### Expected behaviour [期望结果]
   
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 
option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   
   myChart.showLoading();
   
   $.get('data/asset/geo/HK.json', function (geoJson) {
   
       myChart.hideLoading();
   
       echarts.registerMap('HK', geoJson);
   
       myChart.setOption(option = {
           title: {
               text: '香港18区人口密度 (2011)',
               subtext: '人口密度数据来自Wikipedia',
               sublink: 
'http://zh.wikipedia.org/wiki/%E9%A6%99%E6%B8%AF%E8%A1%8C%E6%94%BF%E5%8D%80%E5%8A%83#cite_note-12'
           },
           tooltip: {
               trigger: 'item',
               formatter: '{b}<br/>{c} (p / km2)'
           },
           toolbox: {
               show: true,
               orient: 'vertical',
               left: 'right',
               top: 'center',
               feature: {
                   dataView: {readOnly: false},
                   restore: {},
                   saveAsImage: {}
               }
           },
           visualMap: {
               min: 800,
               max: 50000,
               text:['High','Low'],
               realtime: false,
               calculable: true,
               inRange: {
                   color: ['lightskyblue','yellow', 'orangered']
               }
           },
           series: [
               {
                   name: '香港18区人口密度',
                   type: 'map',
                   mapType: 'HK', // 自定义扩展图表类型
                   label : {
                       show : true,
                       formatter : function(d) {
                           return d.name + '111111111111111';
                       }
                   },
                   data:[
                       {name: '中西区', value: 20057.34},
                       {name: '湾仔', value: 15477.48},
                       {name: '东区', value: 31686.1},
                       {name: '九龙城', value: 37659.78},
                       {name: '黄大仙', value: 45180.97},
                       {name: '观塘', value: 55204.26},
                       {name: '葵青', value: 21900.9},
                       {name: '元朗', value: 4178.01},
                       {name: '沙田', value: 9172.94},
                       {name: '西贡', value: 3368},
                       {name: '离岛', value: 806.98}
                   ],
                   // 自定义名称映射
                   nameMap: {
                       'Central and Western': '中西区',
                       'Eastern': '东区',
                       'Islands': '离岛',
                       'Kowloon City': '九龙城',
                       'Kwai Tsing': '葵青',
                       'Kwun Tong': '观塘',
                       'North': '北区',
                       'Sai Kung': '西贡',
                       'Sha Tin': '沙田',
                       'Sham Shui Po': '深水埗',
                       'Southern': '南区',
                       'Tai Po': '大埔',
                       'Tsuen Wan': '荃湾',
                       'Tuen Mun': '屯门',
                       'Wan Chai': '湾仔',
                       'Wong Tai Sin': '黄大仙',
                       'Yau Tsim Mong': '油尖旺',
                       'Yuen Long': '元朗'
                   }
               }
           ]
       });
   });
   
   ```
   
   
   
   
   ### Other comments [其他信息]
   <!-- For example: Screenshot or Online demo -->
   <!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@echarts.apache.org
For additional commands, e-mail: dev-h...@echarts.apache.org

Reply via email to