~openerp-groupes/openobject-server/6.0-fix-setup-windows

« back to all changes in this revision

Viewing changes to bin/reportlab/graphics/samples/filled_radar.py

  • Committer: pinky
  • Date: 2006-12-07 13:41:40 UTC
  • Revision ID: pinky-3f10ee12cea3c4c75cef44ab04ad33ef47432907
New trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#Autogenerated by ReportLab guiedit do not edit
 
2
from reportlab.graphics.charts.legends import Legend
 
3
from reportlab.graphics.charts.spider import SpiderChart
 
4
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
 
5
from reportlab.graphics.charts.textlabels import Label
 
6
from excelcolors import *
 
7
 
 
8
class FilledRadarChart(_DrawingEditorMixin,Drawing):
 
9
    def __init__(self,width=200,height=150,*args,**kw):
 
10
        apply(Drawing.__init__,(self,width,height)+args,kw)
 
11
        self._add(self,SpiderChart(),name='chart',validate=None,desc="The main chart")
 
12
        self.chart.width      = 90
 
13
        self.chart.height     = 90
 
14
        self.chart.x          = 45
 
15
        self.chart.y          = 25
 
16
        self.chart.strands[0].fillColor  = color01
 
17
        self.chart.strands[1].fillColor  = color02
 
18
        self.chart.strands[2].fillColor  = color03
 
19
        self.chart.strands[3].fillColor  = color04
 
20
        self.chart.strands[4].fillColor  = color05
 
21
        self.chart.strands[5].fillColor  = color06
 
22
        self.chart.strands[6].fillColor  = color07
 
23
        self.chart.strands[7].fillColor  = color08
 
24
        self.chart.strands[8].fillColor  = color09
 
25
        self.chart.strands[9].fillColor  = color10
 
26
        self.chart.strands.fontName      = 'Helvetica'
 
27
        self.chart.strands.fontSize      = 6
 
28
        self.chart.fillColor             = backgroundGrey
 
29
        self.chart.data                  = [(125, 180, 200), (100, 150, 180)]
 
30
        self.chart.labels                = ['North', 'South', 'Central']
 
31
        self._add(self,Label(),name='Title',validate=None,desc="The title at the top of the chart")
 
32
        self.Title.fontName   = 'Helvetica-Bold'
 
33
        self.Title.fontSize   = 7
 
34
        self.Title.x          = 100
 
35
        self.Title.y          = 135
 
36
        self.Title._text      = 'Chart Title'
 
37
        self.Title.maxWidth   = 180
 
38
        self.Title.height     = 20
 
39
        self.Title.textAnchor ='middle'
 
40
        self._add(self,Legend(),name='Legend',validate=None,desc="The legend or key for the chart")
 
41
        self.Legend.colorNamePairs = [(color01, 'Widgets'), (color02, 'Sprockets')]
 
42
        self.Legend.fontName       = 'Helvetica'
 
43
        self.Legend.fontSize       = 7
 
44
        self.Legend.x              = 153
 
45
        self.Legend.y              = 85
 
46
        self.Legend.dxTextSpace    = 5
 
47
        self.Legend.dy             = 5
 
48
        self.Legend.dx             = 5
 
49
        self.Legend.deltay         = 5
 
50
        self.Legend.alignment      ='right'
 
51
        self._add(self,0,name='preview',validate=None,desc=None)
 
52
 
 
53
if __name__=="__main__": #NORUNTESTS
 
54
    FilledRadarChart().save(formats=['pdf'],outDir=None,fnRoot='filled_radar')
 
 
b'\\ No newline at end of file'