Changeset 175

Show
Ignore:
Timestamp:
03/21/09 08:19:39 (17 months ago)
Author:
lgs
Message:

Allow to specify the font of the ticks. Based on a patch by ged_AT_openhex.org. Fixes #26

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/chavier/app.py

    r173 r175  
    5757            labelFontSize=int, 
    5858            labelWidth=float, 
     59            tickFont=str, 
     60            tickFontSize=int, 
    5961            x=dict( 
    6062                hide=bool, 
  • trunk/pycha/chart.py

    r173 r175  
    350350        cx.stroke() 
    351351 
     352        cx.select_font_face(self.options.axis.tickFont, 
     353                            cairo.FONT_SLANT_NORMAL, 
     354                            cairo.FONT_WEIGHT_NORMAL) 
     355        cx.set_font_size(self.options.axis.tickFontSize) 
     356 
    352357        label = unicode(tick[1]) 
    353358        extents = cx.text_extents(label) 
     
    384389        cx.close_path() 
    385390        cx.stroke() 
     391 
     392        cx.select_font_face(self.options.axis.tickFont, 
     393                            cairo.FONT_SLANT_NORMAL, 
     394                            cairo.FONT_WEIGHT_NORMAL) 
     395        cx.set_font_size(self.options.axis.tickFontSize) 
    386396 
    387397        label = unicode(tick[1]) 
     
    638648        labelFontSize=9, 
    639649        labelWidth=50.0, 
     650        tickFont='Tahoma', 
     651        tickFontSize=9, 
    640652        x=Option( 
    641653            hide=False, 
  • trunk/pycha/pie.py

    r169 r175  
    133133        lookup = dict([(slice.xval, slice) for slice in self.slices]) 
    134134 
     135 
     136        cx.select_font_face(self.options.axis.tickFont, 
     137                            cairo.FONT_SLANT_NORMAL, 
     138                            cairo.FONT_WEIGHT_NORMAL) 
     139        cx.set_font_size(self.options.axis.tickFontSize) 
     140 
    135141        cx.set_source_rgb(*hex2rgb(self.options.axis.labelColor)) 
    136142