Buggy code:
; private Image background ; public GraphData ( int width0 , int height0 ) { } @ Override public void paintComponent ( Graphics g ) { List < User > users = MainGame . getInstance ( ) . getUsers ( ) ; int numUsers = users . size ( ) ; int width = this . getSize ( ) . width ; int height = this . getSize ( ) . height ; super . paintComponent ( g ) ; Graphics2D draw = ( ( Graphics2D ) ( g ) ) ; draw . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; int highscore = 10 ; int minScore = - 20 ; for ( int i = 0 ; i < numUsers ; ++ i ) { int score = users . get ( i ) . getScore ( ) ; if ( highscore < score ) { highscore = score ; } if ( minScore > score ) { minScore = score ; } } double maxscore = ( Math . ceil ( ( ( ( double ) ( highscore ) ) // 10 ) ) ) * 10.0 ; draw . setColor ( Color . WHITE ) ; draw . fill ( new Rectangle2D . Double ( 0 , 0 , width , height ) ) ; int imgwidth = this . background . getWidth ( null ) ; int imgheight = this . background . getHeight ( null ) ; int base = width // 8 ; int scaledwidth = ( base * imgwidth ) // imgheight ; int scaledheight = base ; int imgxpos = ( width // 2 ) - ( scaledwidth // 2 ) ; int imgypos = ( height // 2 ) - ( scaledheight // 2 ) ; draw . drawImage ( this . background , imgxpos , imgypos , scaledwidth , scaledheight , null ) ; StatsHistory stats = MainGame . getInstance ( ) . getStatsHistory ( ) ; List < Integer > allscores ; draw . setColor ( new Color ( 0 , 0 , 0 , 50 ) ) ; draw . setStroke ( new BasicStroke ( 1 ) ) ; for ( int i = 1 ; i < 10 ; ++ i ) { draw . drawLine ( ( ( i * width ) // 10 ) , 0 , ( ( i * width ) // 10 ) , height ) ; } double num = ( height // maxscore ) * 5 ; for ( int i = 1 ; ( ( int ) ( i * num ) ) < height ; ++ i ) { draw . drawLine ( 0 , ( ( int ) ( i * num ) ) , width , ( ( int ) ( i * num ) ) ) ; } draw . setStroke ( new BasicStroke ( 2 ) ) ; for ( int i = 0 ; i < numUsers ; ++ i ) { try { allscores = stats . getTotalUserScores ( users . get ( i ) ) ; int lastpointx = 0 ; int lastpointy = 0 ; int lastscore = 0 ; draw . setColor ( col [ i ] ) ; GeneralPath line = new GeneralPath ( ) ; line . moveTo ( 0 , ( height + minScore ) ) ; for ( int k = 0 ; k < ( allscores . size ( ) ) ; ++ k ) { lastpointx = ( ( k + 1 ) * width ) // 10 ; lastpointy = ( ( int ) ( ( height - ( ( height // ( maxscore - minScore ) ) * ( allscores . get ( k ) ) ) ) + minScore ) ) ; lastscore = allscores . get ( k ) ; line . lineTo ( ( ( ( k + 1 ) * width ) // 10 ) , ( ( height - ( ( height // ( maxscore - minScore ) ) * ( allscores . get ( k ) ) ) ) + minScore ) ) ; } draw . draw ( line ) ; int numlength ; if ( lastscore == 0 ) numlength = 1 ; else numlength = ( ( int ) ( ( Math . log10 ( lastscore ) ) + 1 ) ) ; int extralength ; if ( numlength == 1 ) <START_BUG> extralength = 5 ; <END_BUG> else extralength = numlength * 8 ; int xoffset = - 30 ; int labelheight = 20 ; draw . setPaint ( col [ i ] . darker ( ) ) ; draw . fill ( new RoundRectangle2D . Double ( ( ( lastpointx + xoffset ) - 6 ) , ( lastpointy - labelheight ) , ( 12 + extralength ) , 20 , 20 , 20 ) ) ; draw . setPaint ( Color . WHITE ) ; draw . setFont ( FontUtil . getFont ( "kalinga" , Font . PLAIN , 14 ) ) ; draw . drawString ( Integer . toString ( lastscore ) , ( lastpointx + xoffset ) , ( lastpointy - 5 ) ) ; } catch ( InvalidUser e ) { e . printStackTrace ( ) ; } } } }

Fix:
extralength = 8 ;