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 *
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")
13
self.chart.height = 90
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
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
46
self.Legend.dxTextSpace = 5
49
self.Legend.deltay = 5
50
self.Legend.alignment ='right'
51
self._add(self,0,name='preview',validate=None,desc=None)
53
if __name__=="__main__": #NORUNTESTS
54
FilledRadarChart().save(formats=['pdf'],outDir=None,fnRoot='filled_radar')
b'\\ No newline at end of file'