-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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
fix(grid): fix clipping in custom series off by pixel #20043
fix(grid): fix clipping in custom series off by pixel #20043
Conversation
Thanks for your contribution! 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
It seems that the expected clipped area of the custom series on grid is not correct yet.
With
axisLine: {
lineStyle: {
width: 50,
color: 'rgba(255, 0, 0, 0.2)'
}
}
we can see that current clipped area excludes half axisLine width, which is not expected because this makes api.coord(0, 0)
not at the position of the origin of the axes.
So axisLine width should probably not considered in this case.
…o force clipping according to the Grid range.apache#19993
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20043@58cb454 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with visual testing and some cases failed with bar series and are considered to be as expected.
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
Brief Information
This pull request is in the type of:
What does this PR do?
#19993 Clipping in custom series off by 1 pixel
Fixed issues
Details
Before: What was the problem?
There is a boundary overflow issue when creating a clipping path in the custom series.
After: How does it behave after the fixing?
The overflow occurs because the clipping path is widened to fully display the first and last ends of the line chart. In the source code, the logic is to first obtain the width of the polyline, and adjust the clipping path based on this width. After consulting the documentation, I found that under custom If you do not set the lineStyle attribute, you must ensure that the chart without the lineStyle attribute is trimmed strictly according to the grid. Then you only need to set the chart without the lineStyle attribute not to expand.
This change will have an impact on charts that do not have the lineStyle.width attribute but use a clipping path, but the impact is reasonable and acceptable, such as the following case
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information