#NEWLINE# def drawGridLines( self ) : #NEWLINE# #INDENT# leftSide = self . area [ 'xmin' ] #NEWLINE# rightSide = self . area [ 'xmax' ] #NEWLINE# labels = [ ] #NEWLINE# if self . secondYAxis : #NEWLINE# #INDENT# labels = self . yLabelValuesL #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# labels = self . yLabelValues #NEWLINE# #UNINDENT# for ( i , value ) in enumerate ( labels ) : #NEWLINE# #INDENT# self . ctx . set_line_width ( 0.4 ) #NEWLINE# self . setColor ( self . params . get ( 'majorGridLineColor' , self . defaultMajorGridLineColor ) ) #NEWLINE# if self . secondYAxis : #NEWLINE# #INDENT# y = self . getYCoord ( value , 'left' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# y = self . getYCoord ( value ) #NEWLINE# #UNINDENT# if ( ( y is None ) or ( y < 0 ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# self . ctx . move_to ( leftSide , y ) #NEWLINE# self . ctx . line_to ( rightSide , y ) #NEWLINE# self . ctx . stroke ( ) #NEWLINE# if ( ( self . minorY >= 1 ) and ( i < ( len ( labels ) - 1 ) ) ) : #NEWLINE# #INDENT# ( valueLower , valueUpper ) = sorted ( ( value , labels [ ( i + 1 ) ] ) ) #NEWLINE# distance = ( ( valueUpper - valueLower ) / float ( ( 1 + self . minorY ) ) ) #NEWLINE# for minor in range ( self . minorY ) : #NEWLINE# #INDENT# self . ctx . set_line_width ( 0.3 ) #NEWLINE# self . setColor ( self . params . get ( 'minorGridLineColor' , self . defaultMinorGridLineColor ) ) #NEWLINE# value = ( valueLower + ( ( 1 + minor ) * distance ) ) #NEWLINE# if self . logBase : #NEWLINE# #INDENT# yTopFactor = ( self . logBase * self . logBase ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# yTopFactor = 1 #NEWLINE# #UNINDENT# if self . secondYAxis : #NEWLINE# #INDENT# if ( value >= ( yTopFactor * self . yTopL ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( value >= ( yTopFactor * self . yTop ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# if self . secondYAxis : #NEWLINE# #INDENT# y = self . getYCoord ( value , 'left' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# y = self . getYCoord ( value ) #NEWLINE# #UNINDENT# if ( ( y is None ) or ( y < 0 ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# self . ctx . move_to ( leftSide , y ) #NEWLINE# self . ctx . line_to ( rightSide , y ) #NEWLINE# self . ctx . stroke ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# top = self . area [ 'ymin' ] #NEWLINE# bottom = self . area [ 'ymax' ] #NEWLINE# self . ctx . set_line_width ( 0.25 ) #NEWLINE# self . setColor ( self . params . get ( 'minorGridLineColor' , self . defaultMinorGridLineColor ) ) #NEWLINE# ( dt , x_minor_delta ) = find_x_times ( self . start_dt , self . xConf [ 'minorGridUnit' ] , self . xConf [ 'minorGridStep' ] ) #NEWLINE# while ( dt < self . end_dt ) : #NEWLINE# #INDENT# x = ( self . area [ 'xmin' ] + ( to_seconds ( ( dt - self . start_dt ) ) * self . xScaleFactor ) ) #NEWLINE# if ( x < self . area [ 'xmax' ] ) : #NEWLINE# #INDENT# self . ctx . move_to ( x , bottom ) #NEWLINE# self . ctx . line_to ( x , top ) #NEWLINE# self . ctx . stroke ( ) #NEWLINE# #UNINDENT# dt += x_minor_delta #NEWLINE# #UNINDENT# self . ctx . set_line_width ( 0.33 ) #NEWLINE# self . setColor ( self . params . get ( 'majorGridLineColor' , self . defaultMajorGridLineColor ) ) #NEWLINE# ( dt , x_major_delta ) = find_x_times ( self . start_dt , self . xConf [ 'majorGridUnit' ] , self . xConf [ 'majorGridStep' ] ) #NEWLINE# while ( dt < self . end_dt ) : #NEWLINE# #INDENT# x = ( self . area [ 'xmin' ] + ( to_seconds ( ( dt - self . start_dt ) ) * self . xScaleFactor ) ) #NEWLINE# if ( x < self . area [ 'xmax' ] ) : #NEWLINE# #INDENT# self . ctx . move_to ( x , bottom ) #NEWLINE# self . ctx . line_to ( x , top ) #NEWLINE# self . ctx . stroke ( ) #NEWLINE# #UNINDENT# dt += x_major_delta #NEWLINE# #UNINDENT# self . ctx . set_line_width ( 0.5 ) #NEWLINE# self . ctx . move_to ( self . area [ 'xmax' ] , bottom ) #NEWLINE# self . ctx . line_to ( self . area [ 'xmax' ] , top ) #NEWLINE# self . ctx . move_to ( self . area [ 'xmin' ] , bottom ) #NEWLINE# self . ctx . line_to ( self . area [ 'xmin' ] , top ) #NEWLINE# self . ctx . stroke ( )