KaylaChiu opened a new issue #9337: 饼图在配合setInterval使用时数据未能更新的问题
URL: https://github.com/apache/incubator-echarts/issues/9337
 
 
   <!--
   为了方便我们能够复现和修复 bug,请遵从下面的规范描述您的问题。
   -->
   
   
   ### One-line summary [问题简述]
   饼图配合计时器setInterval使用时,当实例重新setOption,
   会出现某一项data的数据未能刷新的情况,即数据仍然为上一次渲染时的数据:
   
   
![image](https://user-images.githubusercontent.com/32062252/47987610-ea3bff80-e11a-11e8-9fc3-7ef128947b06.png)
   
   ,而当鼠标悬停在上面的时候,数据则能恢复正常:
   
   
![image](https://user-images.githubusercontent.com/32062252/47987600-e4461e80-e11a-11e8-90ec-4fe9d9eefe2d.png)
   
   图为在官方实例Doughnut Chart上试验的结果,而出现数据未能刷新的情况也没有规律。
   尝试过手动频繁操作刷新数据,也没有出现类似的情况
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]: 4.1.0-release
   + Browser version [浏览器类型和版本]: chrome 70.0.3538.77
   + OS Version [操作系统类型和版本]: win10
   
   
   ### Expected behaviour [期望结果]
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 
option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   option = {
       tooltip: {
           trigger: 'item',
           formatter: "{a} <br/>{b}: {c} ({d}%)"
       },
       legend: {
           orient: 'vertical',
           x: 'left',
           data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
       },
       series: [
           {
               name:'访问来源',
               type:'pie',
               radius: ['50%', '70%'],
               avoidLabelOverlap: false,
               label: {
                   normal: {
                       show: true,
                       position: 'outside',
                       textStyle: {
                           fontSize: '30'
                       },
                       formatter:'{b}\n{d}%'
                   },
                   emphasis: {
                       show: true,
                       textStyle: {
                           fontSize: '30'
                       }
                   }
               },
               labelLine: {
                   normal: {
                       show: false
                   }
               },
               data:[
                   {value:335, name:'直接访问'},
                   {value:310, name:'邮件营销'},
                   {value:234, name:'联盟广告'},
                   {value:135, name:'视频广告'},
                   {value:1548, name:'搜索引擎'}
               ]
           }
       ]
   }
   
   **setInterval(function(){
       option.series[0].data.forEach(function(ele){
           ele.value = Math.ceil(Math.random() * 100);
       });
       myChart.setOption(option);
   }, 10000);**
   
   ```
   
   
   ### 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]

Reply via email to