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/02/24 06:51:28 UTC

[GitHub] [echarts] Bfly9836 opened a new issue #14329: issue about re-setOption after change data(graph,force)

Bfly9836 opened a new issue #14329:
URL: https://github.com/apache/echarts/issues/14329


   ### Version
   4.8.0
   
   ### Steps to reproduce
   需求: 关系图,鼠标滚轮缩放,页面放大之后显示所有的label(类似地图放大之后看到更详细的内容)
   
   在zoom值到0.5时,获取option , 将label的show 改为true ,然后setoption 发现有一个初始的动画效果 , 重新绘制了图而不是在原来的图上加的.
   所以我加了一行代码关闭动画   clearTimeout(myChart._chartsViews[0]._layoutTimeout);  可还是位置发生了一些改变,想问这种问题改如何解决,就这一种类型的图存在这个问题;
   官方文档这样说的:所有数据的更新都通过 setOption实现,你只需要定时获取数据,setOption 填入数据,而不用考虑数据到底产生了那些变化,ECharts 会找到两组数据之间的差异然后通过合适的动画去表现数据的变化。
   
   代码 myChart.on("graphRoam", (params) =>{
                           let option = myChart.getOption();
                           
                           if(option.series[0].zoom>0.5&&this.isShowUserName===false){
                               option.series[0].label = {
                                   show: true,
                               };
                               myChart.setOption(option);
                               clearTimeout(myChart._chartsViews[0]._layoutTimeout);
                               this.isShowUserName = true
                           }
                           if(option.series[0].zoom<=0.5&&this.isShowUserName===true){
                               option.series[0].label = {
                                   show: false,
                               };
                               myChart.setOption(option);
                               clearTimeout(myChart._chartsViews[0]._layoutTimeout);
                               this.isShowUserName = false
                           }
                       })
   
   ### What is expected?
   how to solve it
   
   ### What is actually happening?
   graph (force)It's different from other chart
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #14329: issue about re-setOption after change data(graph,force)

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14329:
URL: https://github.com/apache/echarts/issues/14329#issuecomment-785738660


   @Bfly9836 Please provide a demo for the issue either with https://codepen.io/Ovilia/pen/dyYWXWM , https://www.makeapie.com/editor.html or https://codesandbox.io/s/mystifying-bash-2uthz.


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #14329: issue about re-setOption after change data(graph,force)

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14329:
URL: https://github.com/apache/echarts/issues/14329#issuecomment-784836594






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