apache / apache/echarts

[Bug] `echarts.connect` - Tooltip is not shown on connected chart if y-axis value is `NaN`

Open
#20,607 0 comments 0 reactions 0 assignees View on GitHub
bug en pending
Dominant language
TypeScript
Stars
67.3k
Forks
19.8k
Avg merge
11d 14h
Merged PRs (30d)
8

Description

### Version

5.5.0

### Link to Minimal Reproduction

https://codepen.io/Francesco-Piemontese-the-sasster/pen/RNbpdJr

### Steps to Reproduce

The attached CodePen should be all you need in order to reproduce - it's just two very basic line charts, with identical data on the x axis, connected via `echarts.connect`. The only peculiarity that some of the y-axis data points are `NaN`.

To trigger the tooltip behaviour in question, simply hover either of the charts on an x-axis value for which the _other_ chart's y-axis value is `NaN`.

### Current Behavior

When the `yAxis` data is not `NaN` in both charts, both tooltips are displayed (as expected), and their position is correctly synced.

image

If, however, in the top chart I hover a datapoint for which the bottom chart has a `NaN` value, only the tooltip for the top chart is shown.

image

This is despite the fact that the top chart's tooltip is also displayed for NaN values.

image

### Expected Behavior

The expected tooltip for each datapoint is shown on both charts, even if the datapoint being hovered is `NaN`

### Environment

```markdown
Originally experienced this working in Angular 18 (both Chrome and Firefox), but could reproduce this in the plain JS environment of CodePen
```

### Any additional comments?

Thank you so much for your help! 💚

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.