Skip to content

Commit

Permalink
refactor(docs): 优化交互使用文档
Browse files Browse the repository at this point in the history
  • Loading branch information
visiky committed Nov 23, 2020
1 parent c9f120f commit c778864
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/common/interactions.zh.md
@@ -1,9 +1,9 @@
#### 介绍

交互(Interaction)是 G2 中的重要 API,通过这个方法可以加载 G2 内置的交互,或者基于交互语法形式自定义的 Interaction 交互。G2 4.0 在交互方面做了非常大的调整,所有的交互代码都是插入式的,通过交互语法进行组织。使用交互的方式也非常简单,仅需要设置交互的名称即可。

在 G2Plot 中,透传了 G2 的交互语法,同时也内置了一些与具体 plot 绑定的交互。

#### 开启交互

使用方式:
```plain
// 开启「鼠标移入图表元素(柱状图的柱子、点图的点等)时触发 active」的交互
Expand All @@ -13,7 +13,7 @@ interactions: [{ type: 'element-active' }]
interactions: [{ type: 'element-active' }, { type: 'brush' }]
```

#### 关闭交互
#### 移除交互

```plain
plot.chart.removeInteraction('interaction-type');
Expand Down

0 comments on commit c778864

Please sign in to comment.