-
Notifications
You must be signed in to change notification settings - Fork 19.8k
fix(dataZoom): detail shape is not the same as data with value axis #17143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! The pull request is marked to be |
TODO: visual testing the dataZoom related changes. |
To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: This message is shown because the PR description doesn't contain the document related template. |
@Ovilia does this also address stacked bar charts being rendered as a data shadow? |
@ianschmitz Current detail view for the stacked bars are not correct because only the first series is considered. I'm not sure this should be included in this PR. I will see if it can be fixed. |
@Ovilia Your fix is still not as perfect as expected (red lines) |
@Ovilia Thank you for having a look into this issue. Your fix breaks the dataZoom panels when nullish data is involved. master branch![]() ![]() fix-17141 branch![]() ![]() TestFile
|
@Ovilia How can I support you to solve this issue? |
Any idea when this will be released to the stable npm channel? Thanks. |
Would be great to have this integrated! |
@Ovilia --help |
Would be great to have this integrated! |
Any idea when it will be ready? |
Brief Information
This pull request is in the type of:
What does this PR do?
The detail view in the dataZoom was not the same as the data in range, like:
In this case, we can see that there are three data points in the dataZoom detail view but only two points in the visible area of the grid.
Why is this PR necessary
The reason why the detail view should be relative to the visible data is that when user changes the range of the dataZoom, the detail view is servered as an important clue and it is confusing to have the two thing being different.
Fixed issues
Details
Before: What was the problem?
The detail view is not the same as the grid area if the axis is a value type.
The main reason for this problem is that, currently, the x position of a horizontal detail region is decided only by the index of data, rather than the x position of the data, similar for y. As a result, the horizontal distance between each points are equal rather than decided by data, and this is the main reason it's different from that in the series.
After: How is it fixed in this PR?
The detail view should be the same as the grid area. So in this PR, I fixed the points in the detail view such that its position is decided by the data in the series rather than data index.
Here are some known differences after this PR:
Case 1: Two value axes for a line series
When the line series has two value axes, the horizontal dataZoom detail view should be consistant with that in the grid area.
The selected area of the dataZoom detail view (green) should be consistant with the line series in the visible grid area.
Please also note that the vertical dataZoom detail views in the second row have changed to be more informative. In the previous implementation (left), the user may get confused about the vertical detail, but in the new implementation (right), the shape in the detail is consistant with the line series (although the areaStyle should be applied from the bottom rather than top).
Case 2: When min/max is provided
When axis min/max is provided, the starting/ending value of the detail view should also be min/max rather than data range.
Case 3: Scatter series
I think the old design (left) is not very informative because it's very confusing how the lines in the detail view relates to scatter series.
But this PR (right) also have problem with scatter series for now because it connects from the first data to the last data using lines in the detail view. This causes the scatter detail to be messy. Maybe it's better to let the series to decide how the detail view looks? I would suggest using the same scatter radius in the detail view because otherwise small scatters may not be visible in the detail view.
Misc
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information