[reportlab-users] Pie chart, change startAngle

Andy Robinson andy at reportlab.com
Tue Jul 2 08:15:52 EDT 2013


It cannot work with sideLabels=1. sideLabels=1 tells the system to
automatically work out the best start angle so that most of the slices
are at the sides, rather than at the top or bottom, so that horizontal
labels are spaced better.

By the way, DoughnutCharts are somewhat incomplete and broken. They
are designed to do multiple nested doughnuts with multiple series, and
many of the label properties make no sense in that context. We
recently added an 'innerRadiusFraction' property to PieChart which
does the same thing - for example, set it to 0.75 and you will get a
fairly thin doughnut with 75% of the radius being the 'hole'. This
does with with sidelabels.

Hope this helps,



On 2 July 2013 13:09, Helga Peters <helga at full-control.nl> wrote:

> I am working on a report including pie charts. Currently the first slice of

> the chart starts on 'East' (default), but I would like it to start at

> 'North'. I have been searching in the documentation and found : 'startAngle

> = 90', but it doesn't seem to work.

> Tested startAngle out with a Doughnut Charts and then it does work, so I am

> overlooking something. Any suggestions ?

> Below my code.

>

> drawing = Drawing(400,200)

> pc = Pie()

> pc.x = 125

> pc.y = 0

> pc.width = 200

> pc.height = 200

> pc.data = [433,760,1520,46806]

> pc.labels = ['Sms', 'Calls', 'Internet','Unused bundle']

> pc.startAngle = 90

> pc.sideLabels = 1

> pc.checkLabelOverlap = 1

>

> pc.simpleLabels = 0

> pc.slices.popout = 20

> pc.slices.strokeWidth = 1

> pc.slices.labelRadius = 1.25

>

> drawing.add(pc)

>

> Thanks in advange,

> Helga

>

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at lists2.reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users

>




--
Andy Robinson
Managing Director
ReportLab Europe Ltd.
Thornton House, Thornton Road, Wimbledon, London SW19 4NG, UK
Tel +44-20-8405-6420


More information about the reportlab-users mailing list