highcharts - Is there a way of dynamically toggling the Highstock navigator to regain vertical space for the chart? -


i'd able able dynamically toggle presence of highstock navigator , allow chart expand vertical space occupied.

i've tried toggling chart.useroptions.navigator.enabled has no effect.

this thread explains how use .hide() , .show() methods conceal individual components of navigator , scrollbar, these use visibility:hidden space not become available chart. however, using .css({display: 'none'}) works, series has no .css() method, , i've been unable find way of removing series navigator.

does know method achieve want?

thanks.

in short: it's not supported hide navigator in real time. best way destroy chart , create new 1 disabled navigator.

other solution use workaround provided sebastian bochan. need update manually yaxis.height, example: http://jsfiddle.net/djbzt/91/

        $('#btn').toggle(function () {             chart.yaxis[0].defaultheight = chart.yaxis[0].height;             chart.xaxis[0].defaultheight = chart.xaxis[0].height;             chart.yaxis[0].update({                 height: 500 - chart.plottop - 35             }, false);             chart.xaxis[0].update({                 height: 500 - chart.plottop - 35             });             chart.scroller.xaxis.labelgroup.hide();             chart.scroller.xaxis.gridgroup.hide();             chart.scroller.series.hide();             chart.scroller.scrollbar.hide();             chart.scroller.scrollbargroup.hide();             chart.scroller.navigatorgroup.hide();             $.each(chart.scroller.elementstodestroy, function (i, elem) {                 elem.hide();             })         }, function () {             chart.yaxis[0].update({                 height: chart.yaxis[0].defaultheight             }, false);             chart.xaxis[0].update({                 height: chart.xaxis[0].defaultheight             });             chart.scroller.xaxis.labelgroup.show();             chart.scroller.xaxis.gridgroup.show();             chart.scroller.series.show();             chart.scroller.navigatorgroup.show();             chart.scroller.scrollbar.show();             chart.scroller.scrollbargroup.show();             $.each(chart.scroller.elementstodestroy, function (i, elem) {                 elem.show();             })         }); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -