Question

In highcharts when I switches from one chart type to another type the zoom selection gets reset to 'All'.

In the following picture I have chosen chart type 'Candle Stick' and zoom type '1M' enter image description here

Now when I change the chart type to 'Line' the zoom type reset to 'All'

enter image description here

I want to prevent from changing zoom type from one selection to another when I change chart type. By the way, is it possible to keep those line which I created in one chart type as it is and when I switches to another chart type it shouldn't remove.Please help. Thanks in advance.

Was it helpful?

Solution

I looked that your question here for your code. The problem is that you aren't updating your chart when your series type changes but instead you are re-creating the whole chart. Anything drawn on it or zoom options that have been changed will not be preserved. So, instead of re-creating the chart, just update it. For instance to change the series type do:

Highcharts.charts[0].series[0].update({'type':type}); // set the first series to a type

See this fiddle example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top