#NEWLINE# def drawSlices( self ) : #NEWLINE# #INDENT# theta = ( ( 3.0 * math . pi ) / 2.0 ) #NEWLINE# halfX = ( ( self . area [ 'xmax' ] - self . area [ 'xmin' ] ) / 2.0 ) #NEWLINE# halfY = ( ( self . area [ 'ymax' ] - self . area [ 'ymin' ] ) / 2.0 ) #NEWLINE# self . x0 = x0 = ( self . area [ 'xmin' ] + halfX ) #NEWLINE# self . y0 = y0 = ( self . area [ 'ymin' ] + halfY ) #NEWLINE# self . radius = radius = ( min ( halfX , halfY ) * 0.95 ) #NEWLINE# for slice in self . slices : #NEWLINE# #INDENT# self . setColor ( slice [ 'color' ] ) #NEWLINE# self . ctx . move_to ( x0 , y0 ) #NEWLINE# phi = ( theta + ( ( 2 * math . pi ) * slice [ 'percent' ] ) ) #NEWLINE# self . ctx . arc ( x0 , y0 , theta , theta , phi ) #NEWLINE# self . ctx . line_to ( x0 , y0 ) #NEWLINE# self . ctx . fill ( ) #NEWLINE# slice [ 'midAngle' ] = ( ( theta + phi ) / 2.0 ) #NEWLINE# slice [ 'midAngle' ] %= ( 2.0 * math . pi ) #NEWLINE# theta = phi