Highcharts图应完全从左侧开始,并完全从右侧结束 [英] Highcharts graph should start entirely to the left and end entirely to the right

查看:196
本文介绍了Highcharts图应完全从左侧开始,并完全从右侧结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆