为什么Highcharts中不接受我的“最大”值?

时间:2013-03-06 07:04:44

标签: highcharts max

摆弄我的图表,我没有成功说服Highcharts将y轴停在5的值。它仍然只在6 Here is the fiddle处继续停止。我设置了

 yAxis:
 { 
    max: 5
 }

但它被忽略了。谢谢你的任何提示!

2 个答案:

答案 0 :(得分:3)

尝试将endOnTick:false添加到y轴。

endOnTick的API。

答案 1 :(得分:0)

您也可以使用函数setExtremes

例如,在load事件中:

 // ...the setting object:

 // some settings...

chart:{
        renderTo: 'container',
        type: 'column',
        spacingBottom: 60,
        marginLeft: 50,
        marginTop: 70,
        events: {
                   load:function(event){                      
                                          var yAxis0=this.yAxis[0];
                                          yAxis0.setExtremes(0, 5 , true, true);
                                       }
                }
},

// other settings.... 

这种方法的优点是你可以动态地改变它(而不仅仅是在初始阶段)