feat(axisPointer): keep pointer on connected charts without data#21656
Open
aggarwal-h wants to merge 1 commit into
Open
feat(axisPointer): keep pointer on connected charts without data#21656aggarwal-h wants to merge 1 commit into
aggarwal-h wants to merge 1 commit into
Conversation
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).
|
Thanks for your contribution! 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief Information
This pull request is in the type of:
What does this PR do?
Adds
axisPointer.triggerOnNoDataso 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,shouldHidebecomes 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(defaultfalse): whentrue, the axis is still processed for an illegal point (e.g. on a connected chart) as long as a value is available from the inputaxesInfo(the linked value) and it is not aleaveevent. The pointer is positioned by the axis value, independent of series data. Theleaveguard and the input-axis restriction are preserved, so hide-on-leave anddispatchActionaxis targeting are unchanged.findPointOnConnectedCharts(defaulttrue): 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.
(New options
axisPointer.triggerOnNoDataandaxisPointer.findPointOnConnectedChartsneed entries in apache/echarts-doc.)Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
test/axisPointer-triggerOnNoData.html
Merging options