Repository navigation
Conversation
…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>
|
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. |
This branch has not been deployed
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?
Locates the axis pointer of connected charts by the axis value instead of the hovered chart's
dataIndex.Fixed issues
echarts.connect- Tooltip is not shown on connected chart if y-axis value isNaN#20607: Tooltip is not shown on connected chart if y-axis value isNaNDetails
Before: What was the problem?
When a chart in a connected group is hovered, the other charts get
updateAxisPointerwith the hovered chart'sseriesIndexanddataIndex, 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:NaN/nullat that index ([Bug]echarts.connect- Tooltip is not shown on connected chart if y-axis value isNaN#20607);0. The point sits on the bottom edge of the grid, and after the pixel is converted back to the local coordinate it can be slightly out of range (e.g.-2e-14), socontainPointfails. Whether this happens depends on the grid size.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. Whenx/yare not given,axisTriggernow 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 passedaxis.containData. TheseriesIndex/dataIndexlookup 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.
Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
test/connect-tooltip-axis-value.htmlhas 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
Other information