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 2018/05/04 06:30:11 UTC

[GitHub] stdrickforce opened a new issue #8284: PieCharts 和 Legend 结合使用时,会产生关键字冲突的问题

stdrickforce opened a new issue #8284: PieCharts 和 Legend 结合使用时,会产生关键字冲突的问题
URL: https://github.com/apache/incubator-echarts/issues/8284
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   
   pieCharts 在使用 legend 的时候,如果数据和图例的名字都为 get 的话,会报错导致图片无法出来。
   
   稍微看了一下,应该是 createHashmap 占用了 get / set / constructor / each / removeKey 这几个关键字,而 legend 组件用到了 hashmap,从而在业务中包含 get 图例时,get 方法被覆盖,导致错误。
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]:
   4.1.0
   + Browser version [浏览器类型和版本]:
   Google Chrome Version 65.0.3325.181 (Official Build) (64-bit)
   + OS Version [操作系统类型和版本]:
   macOS High Sierra Version 10.13.3(17D102)
   
   
   ### Expected behaviour [期望结果]
   可以正常显示 get 的图例
   
   
   
   
   
   ### ECharts option [ECharts配置项]
   ```
   option = {
       title : {
           text: '测试',
           subtext: '纯属虚构',
           x:'center'
       },
       legend: {
           orient: 'vertical',
           left: 'left',
           data: ['get', 'set']
       },
       series : [
           {
               name: '访问来源',
               type: 'pie',
               radius : '55%',
               center: ['50%', '60%'],
               data:[
                   {value:335, name:'get'},
                   {value:310, name:'set'},
               ],
           }
       ]
   };
   
   ```
   
   ### Other comments [其他信息]
   测试代码就在压缩包里
   [test.zip](https://github.com/apache/incubator-echarts/files/1973416/test.zip)
   

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