英文:
Right and center alignment for yAxis not working properly in gantt chart from highcharts
问题
我想自定义y轴上的系列,使其位于右侧/左侧/中间。使用以下属性,我可以实现它:
yAxis: {
uniqueNames: true,
labels: {
align: 'right', // center, left, or right
},
},
但这仅适用于左对齐。对于居中和右对齐,我得到了下面的UI,您可以在图像中看到:
我是否漏掉了什么?或者这就是对齐的工作方式吗?请为这个问题建议一些修复方法。
这是我相同问题的演示代码:
英文:
I want to customize series on the yAxis as right/left/center. with below property I am able to achieve it
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
yAxis : {
uniqueNames: true,
labels: {
align: 'right', // center, left, or right
},
},
<!-- end snippet -->
But this works fine for left alignment only. And for center and right I get this this below UI you can see in image
Am I missing anything here? or this how alignment works?
Please suggest me some fix for this issue.
Here is my demo code for the same.
https://codepen.io/manshi44/pen/KKrzOGy?editors=1111
答案1
得分: 0
这似乎是一个错误,最好在官方Highcharts存储库上报告它:https://github.com/highcharts/highcharts/issues/new/choose
然而,可以通过使用CSS来解决这个问题:
labels: {
align: 'right',
style: {
transform: 'translateX(-35px)'
}
}
解决方法演示:https://jsfiddle.net/BlackLabel/m4nhxe68/
英文:
This seems to be a bug, it would be best to report it on the official Highcharts repository: https://github.com/highcharts/highcharts/issues/new/choose
However, it is possible to work around this by moving the labels using CSS:
<!-- language: lang-js -->
labels: {
align: 'right',
style: {
transform: 'translateX(-35px)'
}
}
Workaround demo: https://jsfiddle.net/BlackLabel/m4nhxe68/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论