public void calcMinMax(){
  if (mDataSets == null)   return;
  mYMax=-Float.MAX_VALUE;
  mYMin=Float.MAX_VALUE;
  mXMax=-Float.MAX_VALUE;
  mXMin=Float.MAX_VALUE;
  for (int i=0, size=mDataSets.size(); i < size; i++) {
    T set=mDataSets.get(i);
    calcMinMax(set);
  }
  mLeftAxisMax=-Float.MAX_VALUE;
  mLeftAxisMin=Float.MAX_VALUE;
  mRightAxisMax=-Float.MAX_VALUE;
  mRightAxisMin=Float.MAX_VALUE;
  T firstLeft=getFirstLeft(mDataSets);
  if (firstLeft != null) {
    mLeftAxisMax=firstLeft.getYMax();
    mLeftAxisMin=firstLeft.getYMin();
    for (int i=0; i < mDataSets.size(); i++) {
      T dataSet=mDataSets.get(i);
      if (dataSet.getAxisDependency() == AxisDependency.LEFT) {
        if (dataSet.getYMin() < mLeftAxisMin)         mLeftAxisMin=dataSet.getYMin();
        if (dataSet.getYMax() > mLeftAxisMax)         mLeftAxisMax=dataSet.getYMax();
      }
    }
  }
  T firstRight=getFirstRight(mDataSets);
  if (firstRight != null) {
    mRightAxisMax=firstRight.getYMax();
    mRightAxisMin=firstRight.getYMin();
    for (int i=0; i < mDataSets.size(); i++) {
      T dataSet=mDataSets.get(i);
      if (dataSet.getAxisDependency() == AxisDependency.RIGHT) {
        if (dataSet.getYMin() < mRightAxisMin)         mRightAxisMin=dataSet.getYMin();
        if (dataSet.getYMax() > mRightAxisMax)         mRightAxisMax=dataSet.getYMax();
      }
    }
  }
}

public void calcMinMax ( ) { if ( mDataSets == null ) return ; mYMax = - Float . MAX_VALUE ; mYMin = Float . MAX_VALUE ; mXMax = - Float . MAX_VALUE ; mXMin = Float . MAX_VALUE ; for ( int i = 0 , size = mDataSets . size ( ) ; i < size ; i ++ ) { T set = mDataSets . get ( i ) ; calcMinMax ( set ) ; } mLeftAxisMax = - Float . MAX_VALUE ; mLeftAxisMin = Float . MAX_VALUE ; mRightAxisMax = - Float . MAX_VALUE ; mRightAxisMin = Float . MAX_VALUE ; T firstLeft = getFirstLeft ( mDataSets ) ; if ( firstLeft != null ) { mLeftAxisMax = firstLeft . getYMax ( ) ; mLeftAxisMin = firstLeft . getYMin ( ) ; for ( int i = 0 ; i < mDataSets . size ( ) ; i ++ ) { T dataSet = mDataSets . get ( i ) ; if ( dataSet . getAxisDependency ( ) == AxisDependency . LEFT ) { if ( dataSet . getYMin ( ) < mLeftAxisMin ) mLeftAxisMin = dataSet . getYMin ( ) ; if ( dataSet . getYMax ( ) > mLeftAxisMax ) mLeftAxisMax = dataSet . getYMax ( ) ; } } } T firstRight = getFirstRight ( mDataSets ) ; if ( firstRight != null ) { mRightAxisMax = firstRight . getYMax ( ) ; mRightAxisMin = firstRight . getYMin ( ) ; for ( int i = 0 ; i < mDataSets . size ( ) ; i ++ ) { T dataSet = mDataSets . get ( i ) ; if ( dataSet . getAxisDependency ( ) == AxisDependency . RIGHT ) { if ( dataSet . getYMin ( ) < mRightAxisMin ) mRightAxisMin = dataSet . getYMin ( ) ; if ( dataSet . getYMax ( ) > mRightAxisMax ) mRightAxisMax = dataSet . getYMax ( ) ; } } } }
calc minimum and maximum values ( both x and y ) over all datasets
