Skip to content

Commit

Permalink
add doc for apache/echarts#16315
Browse files Browse the repository at this point in the history
  • Loading branch information
plainheart committed Dec 31, 2024
1 parent cb1cf96 commit f3ace9a
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 0 deletions.
27 changes: 27 additions & 0 deletions en/option/component/axis-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,11 @@ axisPointer settings on the axis.
) }}
{{ /if }}

{{ use: partial-axis-tooltip(
prefix = ${prefix},
componentType = ${componentType}
) }}

{{ use: partial-animation(
prefix = ${prefix}
) }}
Expand Down Expand Up @@ -1052,3 +1057,25 @@ xAxis: {
}
},
```


{{ target: partial-axis-tooltip }}

#${prefix} tooltip(Object)

{{ use: partial-version(version = '5.6.0') }}

The tooltip configuration for ${componentType}, must set [triggerEvent](~${componentType}.triggerEvent) as `true` and enable global [option.tooltip](~tooltip) component.

##${prefix} show(boolean) = false

<ExampleUIControlBoolean default="false" />

Whether to show the tooltip. Defaults to `false`.

{{ use: partial-tooltip-common(
prefix = '#' + ${prefix},
noValueFormatter = true
) }}


10 changes: 10 additions & 0 deletions en/option/partial/tooltip-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ The first parameter `params` is the data that the formatter needs. Its format is
treeAncestors: {
desc: 'The ancestors of current node in the tree/treemap series (including self)',
type: 'Array'
},
isTruncated: {
desc: 'A function that returns a boolean value to flag if the axis label is truncated',
type: 'Function'
},
tickIndex: {
desc: 'Current index of the axis label tick',
type: 'number'
}
}
) }}
Expand All @@ -347,6 +355,7 @@ formatter: function (params, ticket, callback) {
}
```

{{ if: !${noValueFormatter} }}
#${prefix} valueFormatter(string)

{{ use: partial-version(
Expand All @@ -367,6 +376,7 @@ Example:
// Add $ prefix
valueFormatter: (value) => '$' + value.toFixed(2)
```
{{ /if }}

#${prefix} backgroundColor(Color) = 'rgba(50,50,50,0.7)'

Expand Down
27 changes: 27 additions & 0 deletions zh/option/component/axis-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,11 @@ data: [{
) }}
{{ /if }}

{{ use: partial-axis-tooltip(
prefix = ${prefix},
componentType = ${componentType}
) }}

{{ use: partial-animation(
prefix = ${prefix}
) }}
Expand Down Expand Up @@ -1046,3 +1051,25 @@ xAxis: {
}
},
```


{{ target: partial-axis-tooltip }}

#${prefix} tooltip(Object)

{{ use: partial-version(version = '5.6.0') }}

坐标轴 tooltip 设置,注意需设置 [triggerEvent](~${componentType}.triggerEvent)`true` 并启用全局 [option.tooltip](~tooltip) 组件。

##${prefix} show(boolean) = false

<ExampleUIControlBoolean default="false" />

是否显示提示框组件,默认不启用。

{{ use: partial-tooltip-common(
prefix = '#' + ${prefix},
noValueFormatter = true
) }}


10 changes: 10 additions & 0 deletions zh/option/partial/tooltip-common.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,14 @@ formatter: '{b0}: {c0}<br />{b1}: {c1}'
treeAncestors: {
desc: '树图/矩形树图中当前节点的祖先节点(包括自身)',
type: 'Array'
},
isTruncated: {
desc: '坐标轴标签文本是否溢出隐藏,可以使用此函数判断是否需要弹出提示框',
type: 'Function'
},
tickIndex: {
desc: '当前坐标轴标签刻度索引',
type: 'number'
}
}
) }}
Expand All @@ -352,6 +360,7 @@ formatter: function (params, ticket, callback) {
}
```

{{ if: !${noValueFormatter} }}
#${prefix} valueFormatter(string)

{{ use: partial-version(
Expand All @@ -374,6 +383,7 @@ tooltip 中数值显示部分的格式化回调函数。
// 添加 $ 前缀
valueFormatter: (value) => '$' + value.toFixed(2)
```
{{ /if }}

#${prefix} backgroundColor(Color) = 'rgba(50,50,50,0.7)'

Expand Down

0 comments on commit f3ace9a

Please sign in to comment.