How do I set a minimum upper bound for an axis in Highcharts?

后端 未结 5 845
无人共我
无人共我 2021-01-12 07:04

I\'m trying to set a minimum upper bound, specifically:

  • The Y axis should start at 0
  • The Y axis should go to at least 10, or higher (automatically sca
5条回答
  •  旧时难觅i
    2021-01-12 07:12

    HigtCharts has a really good documentation of all methods with examples.

    http://www.highcharts.com/ref/#yAxis--min

    In your case I think you should the "min" and "max" properties of "yAxis".

    min : Number The minimum value of the axis. If null the min value is automatically calculated. If the startOnTick option is true, the min value might be rounded down. Defaults to null.

    max : Number The maximum value of the axis. If null, the max value is automatically calculated. If the endOnTick option is true, the max value might be rounded up. The actual maximum value is also influenced by chart.alignTicks. Defaults to null.

    If you are creating your chart dynamically you should set

    min=0 max=10 , if your all data values are less then 10

    and

    only min=0, if you have value greater then 10

    Good luck.

提交回复
热议问题