You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2021/04/30 19:22:06 UTC

[echarts-doc] 05/10: doc: add showTip geo.

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

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

commit 4cf74de4754339d48f52a2bb825fb7f6b02c7c33
Author: 100pah <su...@gmail.com>
AuthorDate: Tue Apr 27 15:21:11 2021 +0800

    doc: add showTip geo.
---
 en/api/action.md | 50 +++++++++++++++++++++++++++++++++++---------------
 zh/api/action.md | 51 ++++++++++++++++++++++++++++++++++++---------------
 2 files changed, 71 insertions(+), 30 deletions(-)

diff --git a/en/api/action.md b/en/api/action.md
index 2089381..c34c06a 100644
--- a/en/api/action.md
+++ b/en/api/action.md
@@ -4,21 +4,29 @@
     seriesId?: string | string[],
     seriesName?: string | string[],{{/target}}
 
-{{ target: action-data-query }}// data index; could assign by name attribute when not defined
+{{ target: action-data-query-multiple }}// data index; could assign by name attribute when not defined
     dataIndex?: number | number[],
     // optional; data name; ignored when dataIndex is defined
     name?: string | string[],{{/target}}
 
+{{ target: action-data-query-single }}// data index; could assign by name attribute when not defined
+    dataIndex?: number,
+    // optional; data name; ignored when dataIndex is defined
+    name?: string,{{/target}}
+
 {{ target: action-component-query }}// Find ${componentType} by index or id or name.
     // Can be an array to find multiple components.
     ${componentType}Index?: number | number[],
     ${componentType}Id?: string | string[],
     ${componentType}Name?: string | string[],{{/target}}
 
-{{ target: action-component-item-query }}// ${componentItemDesc} in ${componentType} component.
+{{ target: action-component-item-query-multiple }}// ${componentItemDesc} in ${componentType} component.
     // Can be an array to specify multiple names.
     name?: string | string[],{{/target}}
 
+{{ target: action-component-item-query-single }}// ${componentItemDesc} name in ${componentType} component.
+    name?: string,{{/target}}
+
 
 
 {{ target: action }}
@@ -39,7 +47,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 });
 
 // If highlight geo component:
@@ -48,7 +56,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 });
 ```
 
@@ -64,7 +72,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 });
 
 // If downplay geo component:
@@ -73,7 +81,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 });
 ```
 
@@ -87,7 +95,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 })
 ```
 
@@ -101,7 +109,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 })
 ```
 
@@ -115,7 +123,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 })
 ```
 
@@ -203,7 +211,7 @@ Actions related to [tooltip component](option.html#tooltip), [tooltip component]
 
 Shows tooltip.
 
-There are two usages as followed.
+There are several usages as followed.
 
 1 Display tooltip at certain position relative to container. If it cannot be displayed at the specified location, then it is invalid.
 ```js
@@ -219,19 +227,31 @@ dispatchAction({
 })
 ```
 
-2 Specify graphic element, and display tooltip according to the tooltip configuration item.
+2 Specify graphic element in series, and display tooltip according to the tooltip configuration.
 ```js
 dispatchAction({
     type: 'showTip',
     // index of series, which is optional when trigger of tooltip is axis
     seriesIndex?: number,
-    {{ use: action-data-query }},
+    {{ use: action-data-query-single }},
     // Position of tooltip. Only works in this action.
     // Use tooltip.position in option by default.
     position: Array.<number>|string|Function
 })
 ```
 
+3 Specify graphic element in geo component, and display tooltip according to the tooltip configuration.
+```js
+dispatchAction({
+    type: 'showTip',
+    {{ use: action-component-query(componentType = 'geo') }}
+    {{ use: action-component-item-query-single(componentType = 'geo', componentItemDesc = 'region') }}
+    // Position of tooltip. Only works in this action.
+    // Use tooltip.position in option by default.
+    position: number[] | string | Function
+})
+```
+
 Parameter `position` is the same as [tooltip.position](option.html#tooltip.position).
 
 
@@ -484,7 +504,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 })
 ```
 
@@ -499,7 +519,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 })
 ```
 **EVENT:** [${componentType}unselected](~events.${componentType}unselected)
@@ -513,7 +533,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 })
 ```
 **EVENT:** [${componentType}selectchanged](~events.${componentType}selectchanged)
diff --git a/zh/api/action.md b/zh/api/action.md
index affc030..17d279e 100644
--- a/zh/api/action.md
+++ b/zh/api/action.md
@@ -4,20 +4,29 @@
     seriesId?: string | string[],
     seriesName?: string | string[],{{/target}}
 
-{{ target: action-data-query }}// 数据项的 index,如果不指定也可以通过 name 属性根据名称指定数据项
+{{ target: action-data-query-multiple }}// 数据项的 index,如果不指定也可以通过 name 属性根据名称指定数据项
     dataIndex?: number | number[],
     // 可选,数据项名称,在有 dataIndex 的时候忽略
     name?: string | string[],{{/target}}
 
+{{ target: action-data-query-single }}// 数据项的 index,如果不指定也可以通过 name 属性根据名称指定数据项
+    dataIndex?: number,
+    // 可选,数据项名称,在有 dataIndex 的时候忽略
+    name?: string,{{/target}}
+
 {{ target: action-component-query }}// 用 index 或 id 或 name 来指定 ${componentType} 组件。
     // 可以用数组指定多个 ${componentType} 组件。
     ${componentType}Index?: number | number[],
     ${componentType}Id?: string | string[],
     ${componentType}Name?: string | string[],{{/target}}
 
-{{ target: action-component-item-query }}// ${componentType} 组件中 ${componentItemDesc} 名称。可以是一个数组指定多个名称。
+{{ target: action-component-item-query-multiple }}// ${componentType} 组件中 ${componentItemDesc} 名称。
+    // 可以是一个数组指定多个名称。
     name?: string | string[],{{/target}}
 
+{{ target: action-component-item-query-single }}// ${componentType} 组件中 ${componentItemDesc} 名称。
+    name?: string,{{/target}}
+
 
 {{ target: action }}
 # action
@@ -37,7 +46,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 });
 
 // 如果要高亮 geo 组件:
@@ -46,7 +55,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 });
 ```
 
@@ -61,7 +70,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 })
 
 // 如果要取消高亮 geo 组件:
@@ -70,7 +79,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 });
 ```
 
@@ -84,7 +93,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 })
 ```
 
@@ -98,7 +107,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 })
 ```
 
@@ -112,7 +121,7 @@ dispatchAction({
 
     {{ use: action-series-query }}
 
-    {{ use: action-data-query }}
+    {{ use: action-data-query-multiple }}
 })
 ```
 
@@ -199,7 +208,7 @@ dispatchAction({
 
 显示提示框。
 
-有下面两种使用方式。
+有下面几种使用方式。
 
 1 指定在相对容器的位置处显示提示框,如果指定的位置无法显示则无效。
 ```js
@@ -215,19 +224,31 @@ dispatchAction({
 })
 ```
 
-2 指定数据图形,根据 tooltip 的配置项显示提示框。
+2 指定系列中的数据图形,根据 tooltip 的配置项显示提示框。
 ```js
 dispatchAction({
     type: 'showTip',
     // 系列的 index,在 tooltip 的 trigger 为 axis 的时候可选。
     seriesIndex?: number,
-    {{ use: action-data-query }},
+    {{ use: action-data-query-single }},
     // 本次显示 tooltip 的位置。只在本次 action 中生效。
     // 缺省则使用 option 中定义的 tooltip 位置。
     position: Array.<number>|string|Function,
 })
 ```
 
+3 指定 geo 组件中的 region 名,根据 tooltip 的配置项显示提示框。
+```js
+dispatchAction({
+    type: 'showTip',
+    {{ use: action-component-query(componentType = 'geo') }}
+    {{ use: action-component-item-query-single(componentType = 'geo', componentItemDesc = 'region') }}
+    // 本次显示 tooltip 的位置。只在本次 action 中生效。
+    // 缺省则使用 option 中定义的 tooltip 位置。
+    position: number[] | string | Function,
+})
+```
+
 参数`position`同[tooltip.position](option.html#tooltip.position)相同。
 
 
@@ -466,7 +487,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 })
 ```
 
@@ -481,7 +502,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 })
 ```
 **EVENT:** [${componentType}unselected](~events.${componentType}unselected)
@@ -495,7 +516,7 @@ dispatchAction({
 
     {{ use: action-component-query(componentType = 'geo') }}
 
-    {{ use: action-component-item-query(componentType = 'geo', componentItemDesc = 'region') }}
+    {{ use: action-component-item-query-multiple(componentType = 'geo', componentItemDesc = 'region') }}
 })
 ```
 **EVENT:** [${componentType}selectchanged](~events.${componentType}selectchanged)

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