Control axis visibility: show/hide (toggle) axes
I'm aware that a similar idea has been completed (http://highcharts.uservoice.com/forums/55896-general/suggestions/1813731-hiding-of-y-axis), but what I'm asking for is different:
There are a LOT of users asking for how to hide an axis completely:
http://stackoverflow.com/questions/10877927/hide-axis-and-gridlines-highcharts
http://stackoverflow.com/questions/15277405/highchart-show-hide-an-y-axis-without-hiding-the-series
http://stackoverflow.com/questions/17409041/highcharts-hide-xaxis
etc.
Can we just have a property called "visible" on the Axis object that would show/hide the axis?
Thanks for your patience, this feature is now implemented in the dev branch and will be part of the next maintenance release. See http://jsfiddle.net/highcharts/3sembmfo/ for a live demo.
-
Sujit Joshi commented
I agree with @lukasz. This doesnt work when you have multiple Y axis. For eg., secondary y axis gets hidden correctly. But when you get that axis back...you only see metrics without labels or title. So we have to fall back to the original way of hiding/showing it.
-
lukasz: It seems to work for me (see e.g. http://jsfiddle.net/3sembmfo/26), could you replicate the issue in a jsFiddle and post on our issue tracker on GitHub (https://github.com/highslide-software/highcharts.com/issues)?
-
lukasz commented
this does not seem to work with multiple yAxis series. It hides the axis properly but when turning on the layout is messed up and titles and labels are squeezed.
-
Mike commented
Would love to see this for times I am drawing things manually instead of having axes.
-
Amit Sharma commented
+1
-
Daniel Cook commented
+1 for this. In the meantime:
chart.yAxis[0].hide();
chart.xAxis[0].hide(); -
Paweł Fus commented
Possible solution is to use this snippet: http://jsfiddle.net/39xBU/183/ - now call axis.show() and axis.hide() to manage axis visibility. Note: it won't affect series, use series.hide() and series.show() separately.
-
Charlie commented
+1
-
Anonymous commented
Please do :)
-
Max Mueller commented
Please, implement this!
-
Dan Dascalescu commented
Users on StakOverflow suggest setting a lot of properties, yet the result is still unsatisfactory (see http://stackoverflow.com/a/10878725/1269037). A single "visible" property would be great.