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/show/hide various series of data - but I cannot find an api call which will allow me to dynamically hide the navigator at runtime? Does anyone know of a way to do this - I am reluctant to reload the whole chart unless I have to.
Thanks folks!
You can hide all particular SVG navigator elements by hide() function.
http://jsfiddle.net/dJbZT/1
Sebastian's answer is almost there, but it doesn't actually resize the chart itself, which I think is a requirement in this case because otherwise the navigator's space is completely wasted (not to mention the large blank space looks weird).
Here's a much simpler solution: add a "clipping" div with
overflow: hidden
, and then increase the height of the chart container sufficiently to push the navigator out so it gets hidden.Demo
http://jsfiddle.net/vickychijwani/z4kgsfnp/
It seems as if it is the easiest way to update the navigator.enabled option: