-
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 #9265 axis name overlapped with axis labels for grid.containLabel: true
#12236
Conversation
Thanks for your contribution! |
grid.containLabel: true
function calcDistanceToAxis() { | ||
var axis = axisModel.axis; | ||
if (axis.grid.model.get('containLabel') && !axis.model.get('axisLabel.inside')) { | ||
var labelUnionRect = estimateLabelUnionRect(axis); |
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.
AxisBuilder can also be used on coordinate systems other than grids. In which case, axis.grid may be null. And access grid model in the axis builder is an abstraction leak.
It's better to pass the extra gap calculated from labels from the top. Which can be a parameter in https://github.com/apache/incubator-echarts/blob/master/src/component/axis/CartesianAxisView.js#L60
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 but I don't have time looking into this for now, can you make a fix if the issue is still relevant?
I was really waiting for this fix to come with |
This is still a relevant problem. Is there any chance that this fix is merged in the short term? |
Hey, as this is still a relevant problem - I want to implement the requested changes for this PR. Is there a way this is possible? @pissang @FallenMax |
@konrad-amtenbrink No problem! If it's needed, I'v added you as collaborator to https://github.com/FallenMax/incubator-echarts, feel free to use this branch to make/push any change, or fork echarts and make a separate PR. (Sorry for not being able to finishing the PR myself) |
@FallenMax @pissang After looking at the PR I forked the repository myself and applied the changes already made. There is a new PR open for this issue. I hope this works out for everybody, if not please let me know. The new PR is: #16825 |
Brief Information
This pull request is in the type of:
What does this PR do?
Fixes #9265 . Axis.nameGap will be now be calculated upon
grid.containLabel: true
and axis labels.Fixed issues
Details
Before: What was the problem?
For charts with grid.containLabel set to
true
, axis name could be overlapped with axis labels, ifyAxis.nameGap
is not manually tweaked.Here is how echarts behaves by default (quoting: #9265 (comment)):
After: How is it fixed in this PR?
now axis' name will always placed outside
grid + axis label
rect.nameGap
only adds some additional gap.Usage
Are there any API changes?
Related test cases or examples to use the new APIs
NA.
Others
Merging options
Other information