Re: reportlab-users Digest, Vol 118, Issue 7

Helga Peters <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <CALA9yC1F=dG7rKN-==TPUL6yc1dhMshcS_GODOU4NEXckjwPDA@mail.gmail.com>
Dear Robin,

Thanks for your answer.

Kind Regards,
Helga


2013/11/26 <[email protected]>

> Send reportlab-users mailing list submissions to
>         [email protected]
>
> 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
>         [email protected]
>
> You can reach the person managing the list at
>         [email protected]
>
> 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 <[email protected]>
> Subject: Re: [reportlab-users] HorizontalBarChart(), align,
>         categoryAxis.categoryNames
> To: reportlab-users <[email protected]>
> Message-ID: <[email protected]>
> 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
> [email protected]
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
>
> End of reportlab-users Digest, Vol 118, Issue 7
> ***********************************************
>



-- 
      Met vriendelijke groet,
      Helga Peters
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.