fix #9265 axis name overlapped with axis labels for grid.containLabel: true#12236
fix #9265 axis name overlapped with axis labels for grid.containLabel: true#12236FallenMax wants to merge 1 commit intoapache:masterfrom
grid.containLabel: true#12236Conversation
|
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.
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.
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: trueand 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.nameGapis 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 labelrect.nameGaponly 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