Home Forums Chart Support Trigger reset zooming on wheel zooming Reply To: Trigger reset zooming on wheel zooming

#34224

@myezasifiso,

You can reset the chart range programmatically by setting the viewportMinimum and viewportMaximum of x-axis to null inside the rangeChanged event handler as shown in the code snippet below –

rangeChanged: function(e) {
  if(e.trigger === "reset"){
    e.chart.options.axisX[0].viewportMinimum = null;
    e.chart.options.axisX[0].viewportMaximum = null;
    e.chart.render();
  }
},

Please take a look at this JSFiddle for complete working code.

Resetting zoom on click of reset button

___________
Indranil Deo
Team CanvasJS