Highcharts: Ensure y-Axis 0 value is at chart bottom

后端 未结 8 1805
名媛妹妹
名媛妹妹 2021-02-05 02:18

I\'m outputting a series of highcharts on a page. In some instances, all data for the specified time period may come back with 0 values.

In such a case, the chart looks

8条回答
  •  闹比i
    闹比i (楼主)
    2021-02-05 02:56

    For Highcharts 5.x.x, you should be able to just specify:

    yAxis: {
      softMin: 0,
      softMax: 1,
    };
    

    This won't work for line chart, which requires that you also set minRange in the same config object as above. Experiment with different values, since defining for example minRange: 6, created a range on yAxis between 0 and 4.

提交回复
热议问题