@VisibleForTesting static int calculateSizeShownNext(List<Double> yAxisPoints,double yMinShown,double yMaxShown){
  if (yAxisPoints.size() < 2) {
    return 0;
  }
  double increment=(yAxisPoints.get(1) - yAxisPoints.get(0));
  int startIndex=(int)Math.floor((yMinShown - yAxisPoints.get(0)) / increment + 1);
  int endIndex=(int)Math.ceil((yMaxShown - yAxisPoints.get(yAxisPoints.size() - 1)) / increment) + yAxisPoints.size() - 1;
  return endIndex - startIndex;
}

@ VisibleForTesting static int calculateSizeShownNext ( List < Double > yAxisPoints , double yMinShown , double yMaxShown ) { if ( yAxisPoints . size ( ) < 2 ) { return 0 ; } double increment = ( yAxisPoints . get ( 1 ) - yAxisPoints . get ( 0 ) ) ; int startIndex = ( int ) Math . floor ( ( yMinShown - yAxisPoints . get ( 0 ) ) / increment + 1 ) ; int endIndex = ( int ) Math . ceil ( ( yMaxShown - yAxisPoints . get ( yAxisPoints . size ( ) - 1 ) ) / increment ) + yAxisPoints . size ( ) - 1 ; return endIndex - startIndex ; }
calculates the number of y axis points shown if the same points are used for labeling the updated range shown . if the possible points list is 0 or 1 , there is no way to calculate the difference between y axis labels , so this method returns 0 to prompt a label recalculation .
