Search code examples
highchartslinear-gradientsyaxisangular2-highcharts

Highchart yAxis.ceiling not working properly


I have these 2 fiddles: https://jsfiddle.net/ny6wk3cm/ ceiling not working and https://jsfiddle.net/ap7rswyc/ ceiling working. I can see the ceiling not working properly for the first one, while it's working fine for the second fiddle, which seems weird as all the other config remains the same for both.


Solution

  • Ceiling works similar to max, so if endOnTick option is true, the ceiling value might be rounded up. To have precise values set:

    yAxis: {
        ...,
        tickAmount: undefined,
        ceiling: 36,
        endOnTick: false
    }
    

    Live demo: https://jsfiddle.net/BlackLabel/a81kx32h/

    API Reference: https://api.highcharts.com/highcharts/yAxis.endOnTick