[reportlab-users] reportlab-users Digest, Vol 118, Issue 7
Helga Peters
helga at full-control.nl
Wed Nov 27 03:55:10 EST 2013
Dear Robin,
Thanks for your answer.
Kind Regards,
Helga
2013/11/26 <reportlab-users-request at lists2.reportlab.com>
> Send reportlab-users mailing list submissions to
> reportlab-users at lists2.reportlab.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://two.pairlist.net/mailman/listinfo/reportlab-users
> or, via email, send a message with subject or body 'help' to
> reportlab-users-request at lists2.reportlab.com
>
> You can reach the person managing the list at
> reportlab-users-owner at lists2.reportlab.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of reportlab-users digest..."
>
>
> Today's Topics:
>
> 1. Re: HorizontalBarChart(), align, categoryAxis.categoryNames
> (Robin Becker)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 26 Nov 2013 10:16:55 +0000
> From: Robin Becker <robin at reportlab.com>
> Subject: Re: [reportlab-users] HorizontalBarChart(), align,
> categoryAxis.categoryNames
> To: reportlab-users <reportlab-users at lists2.reportlab.com>
> Message-ID: <52947517.7080600 at chamonix.reportlab.co.uk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi Helga,
>
> you can try something like this
>
> > from reportlab.graphics.charts.barcharts import HorizontalBarChart
> > from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin
> >
> > class Drawing_000(_DrawingEditorMixin,Drawing):
> > def __init__(self,width=400,height=200,*args,**kw):
> > Drawing.__init__(self,width,height,*args,**kw)
> >
> self._add(self,HorizontalBarChart(),name='chart',validate=None,desc=None)
> > self.chart.y = 20
> > self.chart.x = 100
> > self.chart.width = self.width -self.chart.x -10
> > self.chart.height = self.height -self.chart.y -10
> > self.chart.categoryAxis.style='stacked'
> > self.chart.categoryAxis.categoryNames =
> 'AAAA','BBBBBBBBBBB','CC','DDDDDDDDDDDDDDD'
> > self.chart.categoryAxis.labels.fontName =
> 'Helvetica'
> > self.chart.categoryAxis.labels.fontSize = 6
> > self.chart.categoryAxis.labels.boxTarget='lo'
> > self.chart.categoryAxis.labels.boxAnchor='w'
> > self.chart.categoryAxis.labels.dx = -90
> >
> > if __name__=="__main__": #NORUNTESTS
> > Drawing_000().save(formats=['pdf'],outDir='.',fnRoot=None)
>
> effectively we turn the boxAnchor the wrong way and then adjust the anchor
> position with the generic label dx
>
> On 26/11/2013 09:47, Helga Peters wrote:
> > Hello,
> >
> > I am working on a stacked HorizontalBarChart and was wondering whether it
> > is possible to align the categoryAxis.categoryNames to the left, lets say
> > against the red line in example below ?
> >
> > [image: Inline afbeelding 1]
> > Thanks in advance,
>
> --
> Robin Becker
>
>
> ------------------------------
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
>
> End of reportlab-users Digest, Vol 118, Issue 7
> ***********************************************
>
--
Met vriendelijke groet,
Helga Peters
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20131127/168d4e44/attachment.html>
More information about the reportlab-users
mailing list