daniellin01 opened a new issue #8489: geo.label.formatter 无效 URL: https://github.com/apache/incubator-echarts/issues/8489 <!-- 为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。 --> ### One-line summary [问题简述] 配置项 geo.label.formatter 无效 console.log()语句都不运行 ``` label: { normal: { show: false, formatter: function(params) { console.log(params) return nameMap[params.name] } }, emphasis: { show: true, color: '#fff' } }, ``` 在echarts 3.8.5版本这配置项是没有问题的 ### Version & Environment [版本及环境] + ECharts version [ECharts 版本]: 4.1.0 + Browser version [浏览器类型和版本]: chrome 66.0.3359.181 + OS Version [操作系统类型和版本]: Win10 ### Expected behaviour [期望结果] 默认label是显示英文国家名 通过一个对照 我想把英文改为中文 但formatter配置项并没有运行 ### ECharts option [ECharts配置项] <!-- Copy and paste your 'echarts option' here. --> <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] --> ```javascript option = { geo: { map: 'world', roam: 'move', left: 0, top: 0, right: 0, bottom: 0, label: { normal: { show: false, formatter: function(params) { console.log(params) return nameMap[params.name] } }, emphasis: { show: true, color: '#fff' } }, itemStyle: { normal: { borderWidth: 1, borderColor: '#9b9b9c', color: '#1c296f' }, emphasis: { areaColor: 'rgb(45, 31, 49)', borderWidth: 2, borderColor: 'rgb(58, 154, 214)', shadowColor: 'rgb(58, 154, 214)', shadowBlur: 10 } } }, series: [ { name: this.mapData.loc, type: 'lines', zlevel: 1, symbol: [`image://${circular_green}`], symbolSize: 30, effect: { show: true, symbol: 'triangle', symbolSize: 12, period: 6, trailLength: 0 }, lineStyle: { normal: { color: '#fdbe01', width: 1.2, curveness: 0.3, opacity: 1 } }, data: this.mapData ? this.convertLinesData(this.mapData) : [] }, { type: 'scatter', coordinateSystem: 'geo', zlevel: 2, symbol: `image://${circular_red}`, symbolSize: 30, label: { normal: { show: true, position: 'bottom', color: '#fff', formatter: function(params) { return params.data.ipAddress } }, emphasis: { show: true } }, data: this.convertEffectScatterData(this.mapData) } ] } ``` ### 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: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
