apache / apache/echarts

[Feature] I hope to get all series information when tooltip.trigger = item

Open
#20,579 3 comments 0 reactions 0 assignees View on GitHub
new-feature pending topic: tooltip
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?

`tooltip.formatter` 方法接受一个 `params` 参数,当 `tooltip.trigger = item` 的,`params` 是当前 hover 的 series data,当 `tooltip.trigger = axis` 时,`params` 是一个数组,包含所有的 series data

我需要在 `tooltip.trigger = item` 的时候,在 tooltip 中也展示所有的 series 信息,所以我希望 `tooltip.trigger = item` 的,也可以获取到所有的 series data

---

The `tooltip.formatter` method accepts a params. When `tooltip.trigger = item`, `params` is the series data of the current hover. When `tooltip.trigger = axis`, `params` is an array containing all series data.

I need to display all series info in the tooltip when `tooltip.trigger = item`, so I hope to get all series data when `tooltip.trigger = item`.

### What does the proposed API look like?

当 `trigger = 'item'` 时可以新增一个 context 参数:
```ts
tooltip: {
trigger: 'item',
formatter: (params, context) => {
console.log(context);
}
}
```

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.