Skip to content

feat(axisPointer): keep pointer on connected charts without data#21656

Open
aggarwal-h wants to merge 1 commit into
apache:masterfrom
aggarwal-h:feat/axispointer-trigger-on-no-data
Open

feat(axisPointer): keep pointer on connected charts without data#21656
aggarwal-h wants to merge 1 commit into
apache:masterfrom
aggarwal-h:feat/axispointer-trigger-on-no-data

Conversation

@aggarwal-h

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Adds axisPointer.triggerOnNoData so connected charts keep showing the axisPointer at the linked axis value even where they have no data, instead of hiding it.

Details

Before: What was the problem?

With echarts.connect, hovering over one chart replays the action on the others. On a connected chart, the original pixel point is meaningless, so the point is treated as illegal. When that chart also has no data at the sample location, the point stays illegal, shouldHide becomes true, and the axisPointer is hidden, even though the hovered axis value is known and the chart has a valid axis range. The pointer disappears on the chart with no data, which is confusing for synced time-series dashboards.

After: How does it behave after the fixing?

Two opt-in options on axisPointer (both default to current behavior):

  • triggerOnNoData (default false): when true, the axis is still processed for an illegal point (e.g. on a connected chart) as long as a value is available from the input axesInfo (the linked value) and it is not a leave event. The pointer is positioned by the axis value, independent of series data. The leave guard and the input-axis restriction are preserved, so hide-on-leave and dispatchAction axis targeting are unchanged.
  • findPointOnConnectedCharts (default true): chart-wide option to skip looking up a sample series point when the incoming point is illegal, so the pointer follows the linked value instead of snapping to a sample data point.

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

(New options axisPointer.triggerOnNoData and axisPointer.findPointOnConnectedCharts need entries in apache/echarts-doc.)

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/axisPointer-triggerOnNoData.html

Merging options

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

Add `axisPointer.triggerOnNoData` (default `false`). When enabled, a
connected chart still shows its axisPointer at the linked axis value
where it has no data, instead of hiding it. The pointer is driven by
the axis value (propagated via the action `axesInfo`), not by whether
a series has data at that point.

Add `axisPointer.findPointOnConnectedCharts` (default `true`). Set it
to `false` to skip snapping to a sample series point on connected
charts, so the pointer follows the linked value only.

Both options default to the existing behavior, so charts that do not
opt in are unaffected. Add a visual test
(test/axisPointer-triggerOnNoData.html).
@echarts-bot

echarts-bot Bot commented Jun 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.

Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.

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