简体   繁体   English

在图表上声明高图柱的位置?

[英]Declaring location of highchart bars on a chart?

I have highchart and which looks like this ;[if i commented out max value of xAxis i see this image below ] 我有highchart,它看起来像这样; [如果我注释掉xAxis的最大值,我会在下面看到此图]

在此处输入图片说明

Here is the similar jsfiddle ; 这是类似的jsfiddle;

Jsfiddle Link for similar case Jsfiddle Link类似案例

I want to push the bars to all the way left side of the chart. 我想将条形图推到图表的最左侧。

I actually can do it using hard coded json value on max: of xAxis . 我实际上可以使用xAxis的max:上的硬编码json值来做到这一点。 but my json value depends on year+month+day+hours+min+sec. 但我的json值取决于year+month+day+hours+min+sec. so when some of the values here are changed , then i have to change the hard coded value to something else so it is not logical . 所以当这里的一些值改变了时,我必须把硬编码的值改成其他值,这样就不合逻辑了。

If there is anyway using a max value dynamically Please help me. 如果仍然动态使用最大值,请帮助我。

Thanks 谢谢

Solution is to increase maxPadding , demo . 解决方法是增加maxPaddingdemo

More info about maxPadding in the API : 有关API中 maxPadding更多信息:

Padding of the max value relative to the length of the axis. 最大值相对于轴长度的填充。 A padding of 0.05 will make a 100px axis 5px longer. 填充0.05将使100px的轴长5px。 This is useful when you don't want the highest data value to appear on the edge of the plot area. 当您不希望最高数据值出现在绘图区域的边缘时,这很有用。 When the axis' max option is set or a max extreme is set using axis.setExtremes(), the maxPadding will be ignored. 当使用axis.setExtremes()设置了轴的max选项或设置了一个最大极限值时,maxPadding将被忽略。 Defaults to 0.01. 默认值为0.01。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM