score:1

Accepted answer

For example in the load event you can remove specific labels and gridLines:

chart: {
    events: {
        load: function() {
            var chart = this,
                yAxis = chart.yAxis[0],
                gridLines = yAxis.gridGroup.element.children,
                ticks = yAxis.ticks,
                tickPositions = yAxis.tickPositions;

            gridLines[2].remove();
            ticks[tickPositions[2]].label.element.remove();
        }
    }
}

Live demo: http://jsfiddle.net/BlackLabel/5m0s7th2/

API Reference: https://api.highcharts.com/highcharts/chart.events.load

score:0

Using the accepted answer I did this in a loop to avoid losing my middle gridline and tick val.

events: {
    load: function() {
        var chart = this,
            yAxis = chart.yAxis[0],
            gridLines = yAxis.gridGroup.element.children,
            ticks = yAxis.ticks,
            tickPositions = yAxis.tickPositions;
        var i = 4;
        while(i > -1){
            if(i !== 2){
                gridLines[i].remove();  // the whole array element is removed from gridLines, so we're doing this backwards
                ticks[tickPositions[i]].label.element.remove();
            }
            i--;
        }
    }
}

It became a problem when I was starting from 0 using either the accepted answer or my loop. Hope this helps anyone who may have a ton of gridlines.


Related Query

More Query from same tag