manusvs650
Posts: 7
Joined: Tue Nov 30, 2010 9:28 am
Contact: Website

How to hide title of unused axis

Hello,

I have a chart whith multiples axis and i'd like to hide the title of axis when it's not used. Is itpossible ?
Attachments
Capture-1.png
Capture-1.png (25.14 KiB) Viewed 2068 times
jlbriggs
Posts: 1465
Joined: Tue Sep 21, 2010 2:33 pm

Re: How to hide title of unused axis

Code: Select all

title:{
     text:null
}
should do the trick
fiddles: http://jsfiddle.net/jlbriggs/J9JLr/
manusvs650
Posts: 7
Joined: Tue Nov 30, 2010 9:28 am
Contact: Website

Re: How to hide title of unused axis

Thanks for your answer but i want to hide it only when this axis isn't used
qbert
Posts: 22
Joined: Mon Oct 04, 2010 10:16 am

Re: How to hide title of unused axis

I have a similar problem: I want to toggle the axes when hiding/showing the series but instead of the legend I use my own buttons. Is there a way to achieve this?
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

Re: How to hide title of unused axis

Currently the axis titles and lines will be visible even when hiding associated axes.
Torstein Hønsi
CTO, Founder
Highsoft
Romain.Didier
Posts: 1
Joined: Thu Jun 16, 2011 2:01 pm

Re: How to hide title of unused axis

Hello,

I have a graph with axis used by multiple series.
To hide axis title when it is unused, I add this piece of code.

Code: Select all

plotOptions: {
	series: {
	    	events: {
			hide: function(a) {
				for (var i = 0; i < chart.series.length; ++i) 
					if (chart.series[i].yAxis == this.yAxis && chart.series[i].visible) return;
				this.yAxis.axisTitle.hide();
			},
			show: function() {
				this.yAxis.axisTitle.show();
			}
		}
	}
},

Return to “Highcharts Usage”