You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2022/08/12 06:40:22 UTC

[echarts-doc] branch master updated: add some annotations for `finished` event

This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-doc.git


The following commit(s) were added to refs/heads/master by this push:
     new 3feccb0c add some annotations for `finished` event
3feccb0c is described below

commit 3feccb0c4c935e75d6f29d4b2d3a49e40d79bb1d
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Fri Aug 12 14:38:50 2022 +0800

    add some annotations for `finished` event
---
 en/api/events.md | 14 ++++++++++++++
 zh/api/events.md | 14 ++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/en/api/events.md b/en/api/events.md
index 1ef9c41b..5d0d9ae2 100644
--- a/en/api/events.md
+++ b/en/api/events.md
@@ -516,6 +516,20 @@ chart.on('finished', function () {
 });
 ```
 
+Note that it's recommended to register the callbacks for such an event before `setOption` in case the callbacks may not be called as expected due to the timing issue when the animation is disabled.
+
+```ts
+var option = {
+    // ...
+    animation: false
+    // ...
+};
+chart.on('finished', function () {
+    // ...  
+});
+chart.setOption(option);
+```
+
 
 
 {{ target: event-select }}
diff --git a/zh/api/events.md b/zh/api/events.md
index 4f79f611..fd292d2d 100644
--- a/zh/api/events.md
+++ b/zh/api/events.md
@@ -505,6 +505,20 @@ chart.on('finished', function () {
 });
 ```
 
+注意:建议在调用 `setOption` 前注册相关事件,否则在动画被禁用时,注册的事件回调可能因时序问题而不被执行。
+
+```ts
+var option = {
+    // ...
+    animation: false
+    // ...
+};
+chart.on('finished', function () {
+    // ...  
+});
+chart.setOption(option);
+```
+
 
 
 {{ target: event-select }}


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