Home Forums Report Bugs multiple chart axisY zooming problem Reply To: multiple chart axisY zooming problem

#42429

@ali136m,

To overcome the issue you are facing, you can hide the dataseries which are outside of the viewport range by setting visible property to ‘false’ in rangeChanging event handler. Please take a look at the code snippet below for the same.


rangeChanging: function(e) {
  if(e.stockChart.charts[0].data.length > 1) {
    var chart = e.stockChart.charts[0];
    for(i=1; i<chart.data.length; i++) {
      if(chart.options.data[i].minMaxXValue[0] > e.maximum || chart.options.data[i].minMaxXValue[1] < e.minimum)
        chart.data[i].get('visible') && chart.data[i].set('visible', false, false);
      else
        !chart.data[i].get('visible') && chart.data[i].set('visible', true, false);
    }
  }
}

Also, check out this updated JSFiddle for complete working code.

—-
Manoj Mohan
Team CanvasJS