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 2022/07/09 03:00:43 UTC

[GitHub] [echarts] jiawulin001 commented on issue #17338: [Bug] leaveTo not work

jiawulin001 commented on issue #17338:
URL: https://github.com/apache/echarts/issues/17338#issuecomment-1179466767

   Hi, since I didn't find examples about the `leaveTo` animation so my best guess is that `notMerge` option cut the animation off. But I did find a workaround for you, which is use another graphic to "replace" it in `$action`. Check the following code for reference.
   <details>
   <summary>Code Sample</summary>
   
   ```
   option = {
     graphic: [
       {
         type: 'rect',
         x: 100,
         y: 100,
         shape: {
           width: 200,
           height: 200
         },
         enterFrom: {
           // 淡入
           style: { opacity: 0 },
           // 从左飞入
           x: 0
         },
         leaveTo: {
           style: {
             opacity: 0
           },
           x: 200
         },
         leaveAnimation: {
           duration: 1000
         }
       }
     ]
   };
   
   setTimeout(function() {
     myChart.setOption({
       graphic: [
       {
         type: 'circle',
         x: 100,
         y: 100,
         shape: {
           r: 0
         },
         $action:'replace',
       }
     ]
     });
   }, 2000);
   ```
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

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