Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tooltip.md #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions bizCharts/zh/api/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
* 'click': 鼠标点击出发;
* 'none': 不触发 tooltip,用户通过 `chart.showTooltip()` 和 `chart.hideTooltip()` 来控制 tooltip 的显示和隐藏。

当然在任何触发方式下,用户都可以通过调用 `chart.showTooltip(point)` 可以控制在固定的位置显示提示信息,参数 point 为画布上的坐标点,格式如下:
```js
const point = {
x: 23,
y: 30
};
```
另外还提供了 chart.getXY({xField: value, yField: value}) 方法,用于获取数据对应在画布空间的坐标。
![image](https://cdn.nlark.com/yuque/0/2018/png/100996/1539840191028-fded845c-8cdb-4112-8fbd-fe36bd588ab1.png?x-oss-process=image/resize,w_746)

#### `inPlot`
* 类型: Boolean
* 描述: 设置是否将 tooltip 限定在绘图区域内,默认为 true,即限定在绘图区域内。
Expand Down Expand Up @@ -192,23 +202,23 @@ itemTpl= '<li data-index={index}>'
* 描述: 用于控制是否允许鼠标进入 tooltip,默认为 false,即不允许进入。

### canvasTooltip 属性
通过设置配置项useHtml:false可以切换为canvasTooltip,以下配置项只有在useHtml为false的时候才能生效。
通过设置配置项useHtml:false可以切换为canvasTooltip,以下配置项只有在useHtml为false的时候才能生效。样式详情见 [绘图属性](connector)。

#### `boardStyle`
* 类型: Object
* 描述: 用于控制tooltip背景板的显示样式,更详细见 [绘图属性]()
* 描述: 用于控制tooltip背景板的显示样式,样式详情见[绘图属性](./graphic)

#### `titleStyle`
* 类型: Object
* 描述: 用于控制tooltip标题的显示样式,更详细见 [绘图属性]()
* 描述: 用于控制tooltip标题的显示样式,样式详情见[绘图属性](./graphic)

#### `nameStyle`
* 类型: Object
* 描述: 用于控制tooltip每一项 name 的显示样式,更详细见 [绘图属性]()
* 描述: 用于控制tooltip每一项 name 的显示样式,样式详情见[绘图属性](./graphic)

#### `valueStyle`
* 类型: Object
* 描述: 用于控制tooltip每一项 value 的显示样式,更详细见 [绘图属性]()
* 描述: 用于控制tooltip每一项 value 的显示样式,样式详情见[绘图属性](./graphic)

#### `itemGap`
* 类型: Number
Expand All @@ -219,11 +229,11 @@ mini tooltip是一种极简的tooltip形式,只显示单个数据的数值。

#### `boardStyle`
* 类型: Object
* 描述: 用于控制tooltip背景板的显示样式,更详细见 [绘图属性]()
* 描述: 用于控制tooltip背景板的显示样式,样式详情见[绘图属性](./graphic)

#### `valueStyle`
* 类型: Object
* 描述: 用于控制tooltip每一项 value 的显示样式,更详细见 [绘图属性]()
* 描述: 用于控制tooltip每一项 value 的显示样式,样式详情见[绘图属性](./graphic)

#### `triangleWidth`
* 类型: Number
Expand Down