Re: Error in piecharts.py
Robin Becker <[email protected]>
| Newsgroups | gmane.comp.python.reportlab.user |
|---|---|
| Message-ID | <[email protected]> |
On 29/10/2019 15:59, Eldon Ziegler wrote: > Too bad, it used to produce really cool 3D pie charts. > ....... it still can, you just need to set up some slices like this ################################################################### from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin from reportlab.graphics.charts.piecharts import Pie3d from reportlab.lib import colors class Drawing_000(_DrawingEditorMixin,Drawing): def __init__(self,width=400,height=200,*args,**kw): Drawing.__init__(self,width,height,*args,**kw) self._add(self,Pie3d(),name='chart',validate=None,desc=None) self.chart.x = 40 self.chart.simpleLabels = 0 self.chart.labels = 'A B C D E F G'.split() self.chart.slices.strokeWidth=0.5 self.chart.slices[3].popout = 10 self.chart.slices[3].strokeWidth = 2 self.chart.slices[3].strokeDashArray = [2,2] self.chart.slices[3].labelRadius = 1.2 self.chart.slices[3].fontColor = colors.red self.chart.slices[0].fillColor = colors.darkcyan self.chart.slices[1].fillColor = colors.blueviolet self.chart.slices[2].fillColor = colors.blue self.chart.slices[3].fillColor = colors.cyan self.chart.slices[4].fillColor = colors.aquamarine self.chart.slices[5].fillColor = colors.cadetblue self.chart.slices[6].fillColor = colors.lightcoral self.chart.slices.labelRadius = 1.1 self.chart.perspective = 70 self.chart.depth_3d = 10 self.chart.sideLabelsOffset = 0.2 self.chart.sideLabels=0 if __name__=="__main__": #NORUNTESTS Drawing_000().save(formats=['pdf'],outDir='.',fnRoot=None) ################################################################### I don't think this shows much about pointer lines thoough :( -- Robin Becker