#NEWLINE# def drawLabels( self ) : #NEWLINE# #INDENT# self . setFont ( ) #NEWLINE# self . setColor ( 'black' ) #NEWLINE# for slice in self . slices : #NEWLINE# #INDENT# if ( self . valueLabels == 'percent' ) : #NEWLINE# #INDENT# if ( ( slice [ 'percent' ] * 100.0 ) < self . valueLabelsMin ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# label = ( '%%%.2f' % ( slice [ 'percent' ] * 100.0 ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . valueLabels == 'number' ) : #NEWLINE# #INDENT# if ( slice [ 'value' ] < self . valueLabelsMin ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( ( slice [ 'value' ] < 10 ) and ( slice [ 'value' ] != int ( slice [ 'value' ] ) ) ) : #NEWLINE# #INDENT# label = ( '%.2f' % slice [ 'value' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# label = str ( int ( slice [ 'value' ] ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# theta = slice [ 'midAngle' ] #NEWLINE# x = ( self . x0 + ( ( self . radius / 2.0 ) * math . cos ( theta ) ) ) #NEWLINE# y = ( self . y0 + ( ( self . radius / 2.0 ) * math . sin ( theta ) ) ) #NEWLINE# if ( self . pieLabels == 'rotated' ) : #NEWLINE# #INDENT# if ( ( theta > ( math . pi / 2.0 ) ) and ( theta <= ( ( 3.0 * math . pi ) / 2.0 ) ) ) : #NEWLINE# #INDENT# theta -= math . pi #NEWLINE# #UNINDENT# self . drawText ( label , x , y , align = 'center' , valign = 'middle' , rotate = math . degrees ( theta ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . drawText ( label , x , y , align = 'center' , valign = 'middle' )