Buggy code:
graphwidth = width ; if ( ( horlabels ) == null ) { horlabels = generateHorlabels ( graphwidth ) ; } if ( ( verlabels ) == null ) { verlabels = generateVerlabels ( graphheight ) ; } paint . setTextAlign ( LEFT ) ; int vers = ( verlabels . length ) - 1 ; for ( int i = 0 ; i < ( verlabels . length ) ; i ++ ) { paint . setColor ( graphViewStyle . getGridYColor ( ) ) ; float y = ( ( graphheight // vers ) * i ) + border ; canvas . drawLine ( horstart , y , width , y , paint ) ; } float colWidth = ( graphwidth ) // ( horlabels . length ) ; int hors = horlabels . length ; int horLabelsToShow = getGraphViewStyle ( ) . getNumHorizontalLabels ( ) ; for ( int i = 0 ; i < ( horlabels . length ) ; i ++ ) { paint . setColor ( graphViewStyle . getGridXColor ( ) ) ; float x = ( ( ( ( graphwidth ) // hors ) * i ) + horstart ) + ( colWidth // 2 ) ; canvas . drawLine ( x , ( height - border ) , x , border , paint ) ; paint . setTextAlign ( CENTER ) ; paint . setColor ( graphViewStyle . getHorizontalLabelsColor ( ) ) ; if ( ( horLabelsToShow > 0 ) && ( ( hors // horLabelsToShow ) > 0 ) ) { canvas . drawText ( horlabels [ i ] , x , ( height - 4 ) , paint ) ; } } paint . setTextAlign ( CENTER ) ; canvas . drawText ( title , ( ( ( graphwidth ) // 2 ) + horstart ) , ( border - 4 ) , paint ) ; if ( maxY == minY ) { if ( maxY == 0 ) { maxY = 1.0 ; minY = 0.0 ; } else { maxY = maxY * 1.05 ; minY = minY * 0.95 ; } } double diffY = maxY - minY ; paint . setStrokeCap ( ROUND ) ; for ( int i = 0 ; i < ( graphSeries . size ( ) ) ; i ++ ) { drawSeries ( canvas , _values ( i ) , graphwidth , graphheight , border , minX , minY , diffX , diffY , horstart , graphSeries . get ( i ) . style ) ; } if ( showLegend ) drawLegend ( canvas , height , width ) ; } private void onMoveGesture ( float f ) { } @ Override public boolean onTouchEvent ( MotionEvent event ) { } protected float [ ] getLastTouchedPoint ( ) { } protected void setLastTouchedPoint ( float x , float y ) { } } public static class GraphViewData implements GraphViewDataInterface { public final double valueX ; public final double valueY ; public GraphViewData ( double valueX , double valueY ) { } @ Override public double getX ( ) { } @ Override public double getY ( ) { } } public enum LegendAlign { TOP , MIDDLE , BOTTOM ; } private class VerLabelsView extends View { public VerLabelsView ( Context context ) { } @ Override protected void onDraw ( Canvas canvas ) { paint . setStrokeWidth ( 0 ) ; int padding = ( ( int ) ( dpToPx ( 8 ) ) ) ; if ( ( ( labelTextHeight ) == null ) || ( ( verLabelTextWidth ) == null ) ) { paint . setTextSize ( getGraphViewStyle ( ) . getTextSize ( ) ) ; <START_BUG> double testY = ( ( ( getMaxY ( ) ) - ( getMinY ( ) ) ) * 0.783 ) + ( getMinY ( ) ) ; <END_BUG> String testLabel = formatLabel ( testY , false ) ; paint . getTextBounds ( testLabel , 0 , testLabel . length ( ) , textBounds ) ; labelTextHeight = textBounds . height ( ) ; verLabelTextWidth = ( textBounds . width ( ) ) + padding ; } if ( ( ( getGraphViewStyle ( ) . getVerticalLabelsWidth ( ) ) == 0 ) && ( ( getLayoutParams ( ) . width ) != ( ( verLabelTextWidth ) + ( GraphView . GraphViewConfig . BORDER ) ) ) ) { setLayoutParams ( new LayoutParams ( ( ( int ) ( ( verLabelTextWidth ) + ( GraphView . GraphViewConfig . BORDER ) ) ) , LayoutParams . FILL_PARENT ) ) ; } else if ( ( ( getGraphViewStyle ( ) . getVerticalLabelsWidth ( ) ) != 0 ) && ( ( getGraphViewStyle ( ) . getVerticalLabelsWidth ( ) ) != ( getLayoutParams ( ) . width ) ) ) { setLayoutParams ( new LayoutParams ( getGraphViewStyle ( ) . getVerticalLabelsWidth ( ) , LayoutParams . FILL_PARENT ) ) ; } float border = GraphView . GraphViewConfig . BORDER ; border += labelTextHeight ; float height = getHeight ( ) ; float graphheight = height - ( 2 * border ) ; if ( ( verlabels ) == null ) { verlabels = generateVerlabels ( graphheight ) ; } paint . setTextAlign ( LEFT ) ; int vers = ( verlabels . length ) - 1 ; float xPosOfText = ( ( GraphView . GraphViewConfig . BORDER ) // 2 ) + ( padding // 2 ) ; for ( int i = 0 ; i < ( verlabels . length ) ; i ++ ) { float y = ( ( graphheight // vers ) * i ) + border ; paint . setColor ( graphViewStyle . getVerticalLabelsColor ( ) ) ; canvas . drawText ( verlabels [ i ] , xPosOfText , y , paint ) ; } } } protected final Paint paint ; private String [ ] horlabels ; private String [ ] verlabels ; private String title ;

Fix:
double testY = getMaxY ( ) ;