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

[GitHub] [echarts] ssthouse commented on issue #15217: 使用树状图tree 的setOptions更新数据后 出现了残留的线图

ssthouse commented on issue #15217:
URL: https://github.com/apache/echarts/issues/15217#issuecomment-866711868


   @DtStorm 可以创建一个复现的demo吗,我这边试下来没有复现:
   
   https://echarts.apache.org/examples/zh/editor.html?c=tree-basic
   
   ```javascript
   myChart.showLoading();
   $.get(ROOT_PATH + '/data/asset/data/flare.json', function (data) {
       myChart.hideLoading();
   
       data.children.forEach(function (datum, index) {
           index % 2 === 0 && (datum.collapsed = true);
       });
       
       const option = {
           tooltip: {
               trigger: 'item',
               triggerOn: 'mousemove'
           },
           series: [
               {
                   type: 'tree',
   
                   data: [data],
   
                   top: '1%',
                   left: '7%',
                   bottom: '1%',
                   right: '20%',
   
                   symbolSize: 7,
   
                   label: {
                       position: 'left',
                       verticalAlign: 'middle',
                       align: 'right',
                       fontSize: 9
                   },
   
                   leaves: {
                       label: {
                           position: 'right',
                           verticalAlign: 'middle',
                           align: 'left'
                       }
                   },
   
                   emphasis: {
                       focus: 'descendant'
                   },
   
                   expandAndCollapse: true,
                   animationDuration: 550,
                   animationDurationUpdate: 750
               }
           ]
       };
       
       
   
       myChart.setOption(option);
       
       setTimeout(function() {
           
           const data = option.series[0].data[0];
           data.children.splice(0, 5);
           myChart.setOption(option, true)
       }, 2000);
   });
   ```
   


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



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