-
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 #11300 #11484
Fix #11300 #11484
Conversation
I got problem to install puppeteer, so this PR hasn't test with test cases. |
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.
src/coord/cartesian/Cartesian2D.js
Outdated
// For aixs type is category, | ||
// only one data shows on viewport just check if it xAxis' value equal to scale | ||
if (axisX.type === 'category' && axisX.scale.count() === 1) { | ||
return data[0] === axisX.scale._extent[0]; |
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.
_extent
is a private variable. You should probably call axisX.scale.getExtent()[0]
to get it.
src/coord/cartesian/Cartesian2D.js
Outdated
return data[0] === axisX.scale._extent[0]; | ||
} | ||
|
||
return axisX.containData(data[0]) |
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.
I'm not sure if you should fix the implementation of axisX.containData
in the case of one data item.
Hi @susiwen8 . I think the main cause is from https://github.com/apache/incubator-echarts/blob/master/src/coord/Axis.js#L88 Current solution of From my perspective, a better solution is using containData: function (data) {
return this.scale.contain(data);
} BTW: You can try using |
@pissang Hi, I have tried |
Hi @susiwen8 sorry for the late reply.
I didn't understand this. Did you mean It will be great if you can give an example to explain it. I tried using |
|
Understand. I think it's another issue: If markPoint should be clipped if it exceed the axis. It should be a logic in mark point. Not in the underlying coordinate system. But in this issue. Using |
For category type, one data show on window just check if scale contains it's value
Close #11300