-
Notifications
You must be signed in to change notification settings - Fork 19.7k
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(datazoom): prevent bar and scatter chart overflowing the graph . … #20718
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
@Ovilia Can you take a look at the PR |
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.
Sorry for the late reply. Please also add test cases, including those with and without dataZoom. From the doc, the case without dataZoom should follow the logic of Clip all the overflowed. With bar width kept.
. If you don't find it intuitive, maybe we should provide new options like series[bar/scatter].filterMode
.
@@ -271,7 +271,22 @@ class AxisProxy { | |||
const valueWindow = this._valueWindow; | |||
|
|||
if (filterMode === 'none') { | |||
return; | |||
each(seriesModels, function (seriesModel) { | |||
if (seriesModel.subType === 'bar' || seriesModel.subType === 'scatter') { |
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.
It may not be a good idea to check subType
here because AxisProxy should have no idea of what series type is. These logic should probably be implemented in their own series code.
…close #19972
Brief Information
This pull request is in the type of:
What does this PR do?
The PR prevents bars and scatter chart from going outside of the graph when zoomed in
Fixed issues
#19972
Details
Before: What was the problem?
In case the filtermode: 'none' and series type is bar or scatter and x axiis type is time, on zooming in too much, the bars would go outside of the graph (beyond axis)
After: How does it behave after the fixing?
The bars and scatter chart stays within the axis.
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