Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the zoom Type dynamically?

I want to change the zoom-type from "x" to "xy" without creating new instance, I want do do it like update() method they have.. located in myChart.options.chart.zoomType

like image 717
user2212908 Avatar asked Dec 07 '22 08:12

user2212908


1 Answers

You can do something like this:

var chart1 = new Highcharts.StockChart({
   chart: {
      zoomType: 'xy', //requried!
      ...
   }
   ...
});

function SwitchToZoomX() {
   chart1.pointer.zoomX = true;
   chart1.pointer.zoomY = false;
   chart1.pointer.zoomHor = true;
   chart1.pointer.zoomVert = false;
}

function SwitchToZoomY() {
   chart1.pointer.zoomY = true;
   chart1.pointer.zoomX = false;
   chart1.pointer.zoomVert = true;
   chart1.pointer.zoomHor = false;
}
like image 138
skotik Avatar answered Jan 29 '23 07:01

skotik