code: function () {
  		var xAxis = this.xAxis,
  			yAxis = this.yAxis,
  			xData = this.processedXData,
  			yData = this.stackedYData || this.processedYData,
  			yDataLength = yData.length,
  			activeYData = [],
  			activeCounter = 0,
  			xExtremes = xAxis.getExtremes(), // #2117, need to compensate for log X axis
  			xMin = xExtremes.min,
  			xMax = xExtremes.max,
  			validValue,
  			withinRange,
  			dataMin,
  			dataMax,
  			x,
  			y,
  			i,
  			j;
  
  		for (i = 0; i < yDataLength; i++) {
  			
  			x = xData[i];
  			y = yData[i];
  
  			// For points within the visible range, including the first point outside the
  			// visible range, consider y extremes
  			validValue = y !== null && y !== UNDEFINED && (!yAxis.isLog || (y.length || y > 0));
  			withinRange = this.getExtremesFromAll || this.cropped || ((xData[i + 1] || x) >= xMin && 
  				(xData[i - 1] || x) <= xMax);
  
  			if (validValue && withinRange) {
  
  				j = y.length;
  				if (j) { // array, like ohlc or range data
  					while (j--) {
  						if (y[j] !== null) {
  							activeYData[activeCounter++] = y[j];
  						}
  					}
  				} else {
  					activeYData[activeCounter++] = y;
  				}
  			}
  		}
  		this.dataMin = pick(dataMin, arrayMin(activeYData));
  		this.dataMax = pick(dataMax, arrayMax(activeYData));
  	}
docs: Calculate Y extremes for visible data