Highcharts图应完全从左侧开始,并完全从右侧结束 [英] Highcharts graph should start entirely to the left and end entirely to the right
问题描述
使用Highcharts,我想让我的图形直接在Y轴的标签旁边开始,并在x轴结束的地方结束.正如您在下面的链接中看到的那样,它的开始是在左边有很多间距,在右边有很多间距.
Using Highcharts I would like to get my graph to start directly next to the labels of the Y-Axis and to end where the x-axis ends. As you can see in the link below it starts with a lot of spacing to the left and a lot of spacing to the right.
推荐答案
这是不可能的,因为您正在为xAxis
使用类别.类别的标签和点始终设置在类别的中间.因此,第一类和最后一个类别具有您要消除的空白.尝试删除categories
,空格应该消失了.
This is not possible since you are using categories for the xAxis
. Labels and points for categories are always set in the middle of the category. The first and last category therefore have the gap you want to get rid of. Try removing categories
, the space should be gone.
这不是错误或问题,它是一个功能.
This is not a bug or problem, it's a feature.
您可以尝试修改xAxis
以使用法线轴而不是类别,并使用自定义标签formatter
来显示所需的值而不是数字.
You could try and modify your xAxis
to use a normal axis not categories and use a custom label formatter
to display the desired values instead of numbers.
或者您可以尝试使用带点的数据选项并将其传递到formatter
.
Or You could try using data options with points and pass it in the formatter
.
这篇关于Highcharts图应完全从左侧开始,并完全从右侧结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!