You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Grid.containLabel is set to true, but axisLabel is still truncated #16875
Echarts is adjusting the grid's width by the width of yAxis label and grid's height by the height of xAxis label. But the overflow in width caused by xAxis label is not considered.
This is a logic bug which fails to achieve the goal of option containLabel, but can be solved quite easily by adjusting grid.width. @plainheart@pissang Do we need a PR to solve this? I can submit one if needed.
Echarts is adjusting the grid's width by the width of yAxis label and grid's height by the height of xAxis label. But the overflow in width caused by xAxis label is not considered.
This is a logic bug which fails to achieve the goal of option containLabel, but can be solved quite easily by adjusting grid.width. @plainheart@pissang Do we need a PR to solve this? I can submit one if needed.
Thank you!
If it's just a custom chart, adjusting grid.width will do the trick.
However, in real application scenarios, the length and number of lable on the X-axis may not be determined, so adjusting grid.width is not elegant.
And in order for all data not to be truncated, there will be too much white space on the right side of the grid.
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!
Activity
jiawulin001 commentedon Apr 13, 2022
This is caused by a bug in the logic of
containLabelhere:echarts/src/coord/cartesian/Grid.ts
Lines 188 to 204 in 2a67f86
Echarts is adjusting the grid's width by the width of yAxis label and grid's height by the height of xAxis label. But the overflow in width caused by xAxis label is not considered.
This is a logic bug which fails to achieve the goal of option
containLabel, but can be solved quite easily by adjustinggrid.width.@plainheart @pissang Do we need a PR to solve this? I can submit one if needed.
whenhi commentedon Apr 13, 2022
Thank you!
If it's just a custom chart, adjusting grid.width will do the trick.
However, in real application scenarios, the length and number of lable on the X-axis may not be determined, so adjusting grid.width is not elegant.
And in order for all data not to be truncated, there will be too much white space on the right side of the grid.
pissang commentedon Apr 13, 2022
@jiawulin001 Yeah it's an bug exists for a long time. A PR will be great!
jiawulin001 commentedon Apr 13, 2022
Sure, submitting a PR.
github-actions commentedon Apr 12, 2024
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
github-actions commentedon Apr 19, 2024
This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!