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 2020/01/26 13:48:00 UTC

[GitHub] [incubator-echarts] leaon4 commented on issue #11493: 树图用setOption更新数据时,发现图有残留BUG

leaon4 commented on issue #11493: 树图用setOption更新数据时,发现图有残留BUG
URL: https://github.com/apache/incubator-echarts/issues/11493#issuecomment-578503538
 
 
   您好,那我详细讲一个方法吧。
   1.进入echarts官网,选择树图的最后一个实例
   2.在示例代码中插入window.myChart=myChart以便控制台可以直接引用
   3.将以下代码复制进控制台中
   var testData = [
       { "name": "3", "children": [] },
       { "name": "3", "children": [{ "name": "2", "children": [] }, { "name": "" }] },
       { "name": "2", "children": [{ "name": "1", "children": [] }, { "name": "3", "children": [] }] },
       { "name": "2", "children": [{ "name": "1", "children": [] }, { "name": "3", "children": [{ "name": "" }, { "name": "4", "children": [] }] }] },
   ];
   testData.forEach((data, index) => {
       setTimeout(() => {
           option.series[0].data = [data];
           myChart.setOption(option);
       }, (index + 1) * 1000);
   });

----------------------------------------------------------------
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: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org