Skip to content

fix(axisPointer): locate connected axis pointer by axis value - #21801

Open
haoziqaq wants to merge 1 commit into
apache:masterfrom
haoziqaq:fix/connect-tooltip-axis-value
Open

haoziqaq wants to merge 1 commit into
apache:masterfrom
haoziqaq:fix/connect-tooltip-axis-value

Conversation

@haoziqaq

@haoziqaq haoziqaq commented Oct 21, 2026 •

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Locates the axis pointer of connected charts by the axis value instead of the hovered chart's dataIndex.

Fixed issues

Details

Before: What was the problem?

When a chart in a connected group is hovered, the other charts get updateAxisPointer with the hovered chart's seriesIndex and dataIndex, and look up the point at the same index in their own series. If that point is missing or judged out of the grid, their tooltip and axis pointer are hidden. This happens when the target series:

So with several connected time series charts, some show the tooltip and some don't.

After: How does it behave after the fixing?

The event already carries axesInfo, the axis value under the pointer, which is what connected charts really have in common. When x / y are not given, axisTrigger now locates the point by that value on the cartesian axis (the other dimension takes the middle of the grid), and skips the pixel check because the value has already passed axis.containData. The seriesIndex / dataIndex lookup is kept as the fallback, e.g. for polar or when no axis value is given.

Document Info

One of the following should be checked.

  • This PR doesn't relate to document changes
  • The document should be updated later
  • The document changes have been made in apache/echarts-doc#xxx

Misc

Security Checking

  • This PR uses security-sensitive Web APIs.

ZRender Changes

  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

test/connect-tooltip-axis-value.html has four connected charts covering the cases above. Click "Hover #40" or hover the first chart: before this change only the first chart shows the tooltip, after it all four do.

Merging options

  • Please squash the commits into a single one when merging.

Other information

…pache#20607

The connected charts used to locate the axis pointer by the seriesIndex and
dataIndex of the hovered chart, which fails when the target series is NaN or
shorter at that index, or the point is on the edge of the grid and judged out
of it due to floating point error. Locate it by the input axis value instead,
and fall back to the sample dataIndex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echarts-bot

echarts-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant