code: function (newMin, newMax) {
              var dataMin = this.dataMin,
                dataMax = this.dataMax,
                options = this.options;
  
              // Prevent pinch zooming out of range. Check for defined is for #1946. #1734.
              if (!this.allowZoomOutside) {
                  if (defined(dataMin) && newMin <= mathMin(dataMin, pick(options.min, dataMin))) {
                      newMin = UNDEFINED;
                  }
                  if (defined(dataMax) && newMax >= mathMax(dataMax, pick(options.max, dataMax))) {
                      newMax = UNDEFINED;
                  }
              }
  
              // In full view, displaying the reset zoom button is not required
              this.displayBtn = newMin !== UNDEFINED || newMax !== UNDEFINED;
  
              // Do it
              this.setExtremes(
                newMin,
                newMax,
                false,
                UNDEFINED,
                { trigger: 'zoom' }
              );
              return true;
          }
docs: Overridable method for zooming chart. Pulled out in a separate method to allow overriding
  in stock charts.