question: protected void prepareYLegend ( ) { ArrayList < Float > yLegend = new ArrayList < Float > ( ) ; if ( mRoundedYLegend ) { float interval = ( mDeltaY ) / ( mYLegendCount - 1 ) ; double log10 = Math . log10 ( interval ) ; int exp = ( int ) Math . floor ( log10 ) ; if ( exp < 0 ) { exp = 0 ; } double tenPowExp = POW_10 [ exp + 5 ] ; double multi = Math . round ( interval / tenPowExp ) ; if ( multi >= 1 ) { if ( multi > 2 && multi <= 3 ) { multi = 3 ; } else if ( multi > 3 && multi <= 5 ) { multi = 5 ; } else if ( multi > 5 && multi < 10 ) { multi = 10 ; } } else { multi = 1 ; } float step = ( float ) ( multi * tenPowExp ) ; log ( " log10 is " + log10 + " interval is " + interval + " mDeltaY is " + mDeltaY + " tenPowExp is " + tenPowExp + " multi is " + multi + " mYChartMin is " + mYChartMin + " step is " + step ) ; float val = 0 ; if ( step >= 1f ) { val = ( int ) ( mYChartMin / step ) * step ; } else { val = mYChartMin ; } while ( val <= mDeltaY + step + mYChartMin ) { yLegend . add ( val ) ; val = val + step ; } if ( step >= 1f ) { mYChartMin = ( int ) ( mYChartMin / step ) * step ; log ( "mYChartMin write --- step >= 1f -- and mYChartMin is " + mYChartMin ) ; } mDeltaY = val - step - mYChartMin ; mYChartMax = yLegend . get ( yLegend . size ( ) - 1 ) ; } else { float interval = ( mDeltaY ) / ( mYLegendCount - 1 ) ; yLegend . add ( mYChartMin ) ; int i = 1 ; if ( ! isDrawOutline ) { i = 0 ; } for ( ; i < mYLegendCount - 1 ; i ++ ) { yLegend . add ( mYChartMin + ( ( float ) i * interval ) ) ; } yLegend . add ( mDeltaY + mYChartMin ) ; } mYLegend = yLegend . toArray ( new Float [ 0 ] ) ; }
target:  setup the Y legend