"Fossies" - the Fresh Open Source Software Archive

Member "reportlab-3.5.32/src/reportlab/graphics/samples/filled_radar.py" (1 Oct 2019, 2699 Bytes) of package /linux/privat/reportlab-3.5.32.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "filled_radar.py" see the Fossies "Dox" file reference documentation.

    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 reportlab.graphics.samples.excelcolors import *
    7 
    8 class FilledRadarChart(_DrawingEditorMixin,Drawing):
    9     def __init__(self,width=200,height=150,*args,**kw):
   10         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.strandLabels.fontName = 'Helvetica'
   27         self.chart.strandLabels.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')