Buggy code:
private ChartComputator computator ; private int axisMargin ; private float density ; private float scaledDensity ; private Paint [ ] labelPaintTab = new Paint [ ] { new Paint ( ) , new Paint ( ) , new Paint ( ) , new Paint ( ) } ; private Paint [ ] namePaintTab = new Paint [ ] { new Paint ( ) , new Paint ( ) , new Paint ( ) , new Paint ( ) } ; private Paint [ ] linePaintTab = new Paint [ ] { new Paint ( ) , new Paint ( ) , new Paint ( ) , new Paint ( ) } ; private float [ ] nameBaselineTab = new float [ 4 ] ; private float [ ] labelBaselineTab = new float [ 4 ] ; private float [ ] separationLineTab = new float [ 4 ] ; private int [ ] labelWidthTab = new int [ 4 ] ; private int [ ] labelHeightTab = new int [ 4 ] ; private int [ ] labelTextAscentTab = new int [ 4 ] ; private int [ ] labelTextDescentTab = new int [ 4 ] ; private int [ ] labelDimensionForMarginsTab = new int [ 4 ] ; private int [ ] labelDimensionForStepsTab = new int [ 4 ] ; private int [ ] tiltedLabelXTranslation = new int [ 4 ] ; private int [ ] tiltedLabelYTranslation = new int [ 4 ] ; private FontMetricsInt [ ] fontMetricsTab = new FontMetricsInt [ ] { new FontMetricsInt ( ) , new FontMetricsInt ( ) , new FontMetricsInt ( ) , new FontMetricsInt ( ) } ; private char [ ] labelBuffer = new char [ 32 ] ; private int [ ] valuesToDrawNumTab = new int [ 4 ] ; private float [ ] [ ] rawValuesTab = new float [ 4 ] [ 0 ] ; private float [ ] [ ] autoValuesToDrawTab = new float [ 4 ] [ 0 ] ; private AxisValue [ ] [ ] valuesToDrawTab = new AxisValue [ 4 ] [ 0 ] ; private float [ ] [ ] linesDrawBufferTab = new float [ 4 ] [ 0 ] ; private AxisAutoValues [ ] autoValuesBufferTab = new AxisAutoValues [ ] { new AxisAutoValues ( ) , new AxisAutoValues ( ) , new AxisAutoValues ( ) , new AxisAutoValues ( ) } ; public AxesRenderer ( Context context , Chart chart ) { } public void onChartSizeChanged ( ) { } public void onChartDataChanged ( ) { } private void onChartDataOrSizeChanged ( ) { } public void resetRenderer ( ) { } private void initAxis ( Axis axis , int position ) { } private void initAxisAttributes ( Axis axis , int position ) { } private void initAxisPaints ( Axis axis , int position ) { } private void initAxisTextAlignment ( Axis axis , int position ) { } private void initAxisDimensionForTiltedLabels ( int position ) { } private void initAxisDimension ( int position ) { } private void intiTiltedLabelsTranslation ( Axis axis , int position ) { } private void initAxisMargin ( Axis axis , int position ) { } private int getAxisNameMargin ( Axis axis , int position ) { } private void insetContentRectWithAxesMargins ( int axisMargin , int position ) { } private void initAxisMeasurements ( Axis axis , int position ) { } public void drawInBackground ( Canvas canvas ) { } private void prepareAxisToDraw ( Axis axis , int position ) { } public void drawInForeground ( Canvas canvas ) { } private void prepareCustomAxis ( Axis axis , int position ) { } private void prepareAutoGeneratedAxis ( Axis axis , int position ) { } private boolean checkRawValue ( Rect rect , float rawValue , boolean axisInside , int position , boolean isVertical ) { } private void drawAxisLines ( Canvas canvas , Axis axis , int position ) { } private void drawAxisBackgroundColor ( Canvas canvas , final Axis axis , int position , boolean drawInBackground ) { } private void setAxisBackgroundColor ( Canvas canvas , final AxisBackgroundColor bg , int position , final Paint fillPaint ) { fillPaint . setColor ( bg . color ) ; fillPaint . setAlpha ( bg . alpha ) ; float rawLeft ; float rawRight ; float rawTop ; float rawBottom ; rawLeft = rawRight = rawTop = rawBottom = 0 ; final Rect contentRect = computator . getContentRectMinusAllMargins ( ) ; <START_BUG> final Viewport viewport = computator . getCurrentViewport ( ) ; <END_BUG> if ( ( ( AxesRenderer . LEFT ) == position ) || ( ( AxesRenderer . RIGHT ) == position ) ) { rawLeft = contentRect . left ; rawRight = contentRect . right ; rawBottom = computator . computeRawY ( ( ( viewport . bottom ) > ( bg . start ) ? viewport . bottom : bg . start ) ) ; rawTop = computator . computeRawY ( ( ( viewport . top ) < ( bg . end ) ? viewport . top : bg . end ) ) ; } else if ( ( ( AxesRenderer . BOTTOM ) == position ) || ( ( AxesRenderer . TOP ) == position ) ) { rawBottom = contentRect . bottom ; rawTop = contentRect . top ; rawLeft = computator . computeRawX ( ( ( viewport . left ) > ( bg . start ) ? viewport . left : bg . start ) ) ; rawRight = computator . computeRawX ( ( ( viewport . right ) < ( bg . end ) ? viewport . right : bg . end ) ) ; } else { return ; } canvas . drawRect ( rawLeft , rawTop , rawRight , rawBottom , fillPaint ) ; } private void drawAxisLabelsAndName ( Canvas canvas , Axis axis , int position ) { } private boolean isAxisVertical ( int position ) { } No newline ; at end ; of file ; }

Fix:
final Viewport viewport = computator . getVisibleViewport ( ) ;