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 85778fa1 improve typings for legend action parameters
(apache/echarts#21025)
85778fa1 is described below
commit 85778fa19146d3019ab36c4926125cae0d0d37c9
Author: plainheart <[email protected]>
AuthorDate: Sun Jun 15 20:28:39 2025 +0800
improve typings for legend action parameters (apache/echarts#21025)
---
en/api/action.md | 20 +++++++++++---------
zh/api/action.md | 20 +++++++++++---------
2 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/en/api/action.md b/en/api/action.md
index 158b8e0e..66603842 100644
--- a/en/api/action.md
+++ b/en/api/action.md
@@ -178,11 +178,9 @@ dispatchAction({
// The following parameters are supported since v5.6.0
// the id of target legend component
- legendId: string,
+ legendId?: string | string[],
// the index of target legend component
- legendIndex: number,
- // the name of target legend component
- legendName: string
+ legendIndex?: number | number[]
})
```
@@ -197,11 +195,9 @@ dispatchAction({
// The following parameters are supported since v5.6.0
// the id of target legend component
- legendId: string,
+ legendId?: string | string[],
// the index of target legend component
- legendIndex: number,
- // the name of target legend component
- legendName: string
+ legendIndex?: number | number[]
})
```
@@ -209,11 +205,17 @@ dispatchAction({
### legendScroll(Action)
Control the scrolling of legend. It works when
[legend.type](option.html#legend.type) is `'scroll'`.
+
```ts
dispatchAction({
type: 'legendScroll',
+ // the index of the legend item to scroll to
scrollDataIndex: number,
- legendId: string
+
+ // the id of target legend component
+ legendId?: string | string[],
+ // the index of target legend component
+ legendIndex?: number | number[]
})
```
diff --git a/zh/api/action.md b/zh/api/action.md
index fcb825e4..fb802b25 100644
--- a/zh/api/action.md
+++ b/zh/api/action.md
@@ -178,11 +178,9 @@ dispatchAction({
// 下列参数自 v5.6.0 起开始支持
// 图例组件ID
- legendId: string,
+ legendId?: string | string[],
// 图例组件索引
- legendIndex: number,
- // 图例组件名称
- legendName: string
+ legendIndex?: number | number[]
})
```
@@ -197,11 +195,9 @@ dispatchAction({
// 下列参数自 v5.6.0 起开始支持
// 图例组件ID
- legendId: string,
+ legendId?: string | string[],
// 图例组件索引
- legendIndex: number,
- // 图例组件名称
- legendName: string
+ legendIndex?: number | number[]
})
```
@@ -209,11 +205,17 @@ dispatchAction({
### legendScroll(Action)
控制图例的滚动。当 [legend.type](option.html#legend.type) 为 `'scroll'` 时有效。
+
```ts
dispatchAction({
type: 'legendScroll',
+ // 要滚动到的目标图例项索引
scrollDataIndex: number,
- legendId: string
+
+ // 图例组件ID
+ legendId?: string | string[],
+ // 图例组件索引
+ legendIndex?: number | number[]
})
```
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]