apache / apache/echarts

Handling click events on chart grid columns

Open
#2,941 22 comments 0 reactions 1 assignee Claimed by @pissang View on GitHub
difficulty: normal enhancement priority: high topic: event
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

#### 问题简述 (One-line summary)

Is there any way to capture click events on chart columns? My goal is to create a chart with possibility to select individual columns by clicking on them.
#### 版本及环境 (Version & Environment)
- ECharts 版本 (ECharts version): 3.1.3
- 浏览器类型和版本 (Browser version): Google Chrome 49.0.2623.110
- 操作系统类型和版本 (OS Version): Windows 8
#### 期望结果 (Expected behaviour)

I would expect that `chart.on('click', () => {
console.log('click');
});` captures click events on the entire chart. Or at least i would expect an option like `grid: { clickable: true }`.
#### 可能哪里有问题 (What went wrong)

`chart.on('click', () => {
console.log('click');
});` registers event only on chart components such as bars etc.
#### ECharts配置项 (ECharts option)

``` javascript
option = {

}

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.