apache / apache/echarts

Display the nearest data of different series in one tooltip.

Open
#15,488 42 comments 19 reactions 0 assignees View on GitHub
en new-feature pending topic: axis
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### What problem does this feature solve?
Is there a way to show the nearest data of different series in one tooltip?

Several series with a common x-axis are displayed on the chart.
Although the time between values may differ, I would like to display a general hint if the time difference is no more than a few seconds.
There can be about 8 series on the chart, a series of 30k - 100k points long, it is large dataset to dynamic search nearest data on tooltip formatter, also dynamic search is very slow. Store nearest data for each point is bad way also it's slow too.

Chart options:
The x-axis is time, the y-axis is value.
```
Series 1: [{x: 1 ms}, {x: 3 ms}, {x: 5 ms}]
Series 2: [{x: 0 ms}, {x: 2 ms}, {x: 6 ms}]
```

### What does the proposed API look like?
May be

```
tooltip: {
nearest: true,
formatter: (params: Object|Array, nearest: Object|Array) =>
}
```

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.