-
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
xAxis.nameGap and yAxis.nameGap should be set automatically given grid.containLabel #9265
Comments
sorry, I don't quite understand what you mean, can you show me the ECharts option and the effect picture you want. |
Certainly! I have included the option in the original post. Explanation: I would like for the x-axis and y-axis names to be set based on the 'rotate' value of the axisLabel property inside xAxis and yAxis. Justification: This is because sometimes the yAxis or xAxis labels overlaps with the yAxis or xAxis name. This is visually unpleasant, and it should be a standard feature that it automatically sets xAxis.nameGap and yAxis.nameGap so that it is not being overlapped by the axis labels. How it should look: |
Do you mean that you want to rotate the axis name or where do you want to place it? Sorry I didn't quite follow. |
Currenly
Another issue #9286 gave a related situation that the axis name might overflow the rendering area. To make the layout wisely, I think two enhancements can be taken into accout (and the two enhancement might be independent with each other in implementation): (A) Enhanse the layout calculation of axis name: adjust it based on axis label and viewport.Keep the current behaviors of Procedure X: Procedure X will be executed twices if Procedure Y: Procedure Y is only be executed in the "cartesian rendering stage", after Procedure X executed. (B) Enhanse the cartesian rect determine calculation when
|
Currently, is there any workaround? |
The workaround was offered in @100pah 's answer. That being said, the 'nameGap' property is – in my opinion – flawed, because the property should not really exist. Any ideas? |
@jbadilla Thanks for answers, but how can I get |
Hi @sunzy0212 ! Sorry I hadn't answered in a while; I've been neglecting this issue in my code, and have implemented a messy (albeit temporarily) solution so I could move on. You should already have access to your categorical labels outside of echarts (e.g. in the data you use to build the chart). alternatively, you can use the Like @100pah says, the problem is not only the axis labels but also the viewport. I will spend some time on this today |
I have the same problem, most of the problems can be solved by calculating nameGap externally, but when yAxis is the category axis, and the categories are very large, echarts will perform display optimization according to |
After reviewing the source code related to the axis, I finally found the way to get the viewLabels in the instance of echarts! |
Hello I just came across this problem in a project I am working on and was wondering the progress for a solution to the nameGap issue? |
Is there any fix/workaround for this issue? |
@AbhaysinghBhosale |
After 3 years, this problem is still relevant. Is there still hope that it will be fixed? Either nameGap is set too high and the text disappears to the left, or it is set too low and overlaps with the numbers on the Y-axis. Would be great if you could fix this. |
Seems like proposed pull request will fix it. Any ideas if it will be merged at some point? |
@pissang has this been fixed in the any version of Chart.js |
Any news? |
在echarts实例setOption后调用下述方法可暂时解决此问题
|
Is above PR will resolve this issue? If yes when can we expect it’s going to live? |
xAxis.nameGap and yAxis.nameGap should be set automatically given grid.containLabel; this would provide the user with an easy way to display his/her axis name in a way that it doesn't visually interfere with the axis labels
One-line summary [问题简述]
Version & Environment [版本及环境]
Expected behaviour [期望结果]
When containLabel is selected, and a name for the xAxis or the yAxis has been specified, these should always fit on the graph's rendering, taking into account the 'rotate' property of the axis labels.
ECharts option [ECharts配置项]
if:
then:
Other comments [其他信息]
The text was updated successfully, but these errors were encountered: