Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geo.label.formatter 无效 #8489

Closed
daniellin01 opened this issue Jun 8, 2018 · 4 comments · Fixed by OpenTMI/opentmi-default-gui#32 or DeviaVir/zenbot#2011 · May be fixed by dyna-dot/iClient-JavaScript-s#1
Closed

geo.label.formatter 无效 #8489

daniellin01 opened this issue Jun 8, 2018 · 4 comments · Fixed by OpenTMI/opentmi-default-gui#32 or DeviaVir/zenbot#2011 · May be fixed by dyna-dot/iClient-JavaScript-s#1

Comments

@daniellin01
Copy link

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配置项]

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 [其他信息]

@pissang pissang added the pending We are not sure about whether this is a bug/new feature. label Jun 9, 2018
@aweffr
Copy link

aweffr commented Aug 9, 2018

我也遇到了相同的问题

@chenhtbilly
Copy link

存在一样的问题

@nihaolfccc
Copy link

我也是。。。。

@susiwen8 susiwen8 removed the pending We are not sure about whether this is a bug/new feature. label Jun 13, 2019
@wang2085
Copy link

wang2085 commented Sep 10, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants