#NEWLINE# def __init__( self ) : #NEWLINE# #INDENT# GChart . __init__ ( self , XChartSize = 300 , YChartSize = 450 ) #NEWLINE# self . setChartTitle ( '<h2>2<sup>x</sup> vs x</h2>' ) #NEWLINE# self . addCurve ( ) #NEWLINE# self . getCurve ( ) . getSymbol ( ) . setHovertextTemplate ( formatAsHovertext ( '${y}=2^${x}' ) ) #NEWLINE# self . getCurve ( ) . setLegendLabel ( '<b>2<sup>x</sup></b>' ) #NEWLINE# self . getCurve ( ) . getSymbol ( ) . setBackgroundColor ( 'red' ) #NEWLINE# self . getCurve ( ) . getSymbol ( ) . setBorderColor ( 'black' ) #NEWLINE# self . getCurve ( ) . getSymbol ( ) . setWidth ( 9 ) #NEWLINE# self . getCurve ( ) . getSymbol ( ) . setHeight ( 9 ) #NEWLINE# for i in range ( ( - 2 ) , 4 ) : #NEWLINE# #INDENT# self . getCurve ( ) . addPoint ( i , log10 ( math . pow ( 2 , i ) ) ) #NEWLINE# #UNINDENT# self . getYAxis ( ) . setTickLabelFormat ( '=10^#.##' ) #NEWLINE# self . getYAxis ( ) . addTick ( log10 ( 0.1 ) ) #NEWLINE# x = 0.1 #NEWLINE# while ( x < 10 ) : #NEWLINE# #INDENT# for y in range ( 2 , 11 ) : #NEWLINE# #INDENT# self . getYAxis ( ) . addTick ( log10 ( ( self * y ) ) ) #NEWLINE# #UNINDENT# x *= 10 #NEWLINE# #UNINDENT# self . getXAxis ( ) . setAxisLabel ( '<b>x</b>' ) #NEWLINE# self . getXAxis ( ) . setHasGridlines ( True ) #NEWLINE# self . getXAxis ( ) . setTickCount ( 6 ) #NEWLINE# self . getYAxis ( ) . setAxisLabel ( '<b>2<sup>x</sup></b>' ) #NEWLINE# self . getYAxis ( ) . setHasGridlines ( True )