ygxw commented on issue #10145: bmap下data数据绑定value值失效
URL: 
https://github.com/apache/incubator-echarts/issues/10145#issuecomment-552316395
 
 
   > ..自问自答吧。(echart的配置项也太多了) 官方例子那边的tooltip的确有问题。
   > 
要修改的话,需要自己去定义[tooltip](https://echarts.baidu.com/option.html#series-scatter.tooltip.formatter).
   > 
   > map类的tooltip,看文档是只支持{a}{b}{c} 
c是混合数据,也就是formatter没法用字符串模板去写.官方还提供了了一个回调函数的方法,可以解决这个问题。有点神奇的是这个函数支持返回一个string类型的html模板(并不是jsx),如果有心的话可以玩出花来。
   > 
   > ```
   > tooltip: {
   >                 formatter: function (params) {
   >                       return `<div style='color:#00FFFF'>
   >                         ${params.data.name}: ${params.data.value[2]}
   >                       <div>`
   >                 }
   >  }
   > ```
   
   
无比汗颜~echarts用了好久了,越到后面感觉越恼火,今天我也遇到这个问题了,始终给我默认把“维度”显示在tooltip里,折腾了一上午,结果忽然看到你的issue,,一下子反应过来,这货还有个tooltip属性呀(其实之前也常用,只是一下在bmap里没反应过来),哎~~都用晕了。而且官方文档实在太挫了。
   thx.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to