You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2019/05/06 07:23:14 UTC

[GitHub] [incubator-echarts] cos800 commented on issue #10399: 树图的每个项目显示不同的图片

cos800 commented on issue #10399: 树图的每个项目显示不同的图片
URL: https://github.com/apache/incubator-echarts/issues/10399#issuecomment-489523071
 
 
   Echarts里的树图,能不能把每个项目图标改成不同的图片?
   
   我看了echarts的文档,
   https://www.echartsjs.com/option.html#series-tree.symbol
   有说:
   
   > 如果需要每个数据的图形不一样,可以设置为如下格式的回调函数:
   > `(value: Array|number, params: Object) => number|Array`
   > 其中第一个参数 value 为 data 中的数据值。第二个参数params 是其它的数据项参数。
   
   所以我把 `symbol: 'emptyCircle'` 改成:
   ```
   symbol: function (value, params) {
       console.log('symbol callback:', value, params);
       return 'emptyCircle';
   },
   ```
   按道理 只要有执行这个回调函数,console就会有输出。
   但是并没有,却输出一个错误:
   
   ![image](https://user-images.githubusercontent.com/635184/57211429-d4988b80-7012-11e9-8deb-6f99266b1ec3.png)
   
   这是echarts的bug吗?
   还是我写法有什么问题?
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

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