Is it possible to hide the navigator in highcharts at runtime?

前端 未结 3 1230
时光取名叫无心
时光取名叫无心 2021-01-05 19:41

I am working on a highcharts project where we have a requirement to show/hide the navigator at runtime, depending on the value of an on screen filter.

We already add

3条回答
  •  温柔的废话
    2021-01-05 19:45

    You can hide all particular SVG navigator elements by hide() function.

    http://jsfiddle.net/dJbZT/1

    $('#btn').toggle(function () {
                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.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();
                })
            });
    

提交回复
热议问题