score:13

Accepted answer

this actually turns out to be a much sought after question/answer. since highcharts v2.2, it is possible to assign "showempty: false" to y axis definitions and this will ensure that when hidden, the y-axis text label is also hidden. example snippet of config below:

                 yaxis: [{
                min: 0,
                showempty: false,
                labels: {
                    formatter: function() {
                        return this.value;
                    },
                    style: {
                        color: '#3366cc'
                    }
                },
                title: {
                    text: 'clicks',
                    style: {
                        color: '#3366cc'
                    }
                },
                id: 'clicks'
            }, 
                 ...

i have read reports where this showenabled = false breaks if both min and max are also set. in the case above, where only min is set, it worked well for me using highcharts v3.0.5

score:0

@arcseldon, it is true that showenabled = false breaks if both min and max are also set. a possible workaround in this case is to set floor and max instead

score:1

you can use yaxis.settitle() and set/remove the title when needed.

here is the api documentation link


Related Query

More Query from same tag