[reportlab-users] Charts and Axes dimensions
troy.caldwell at covchurch.org
Mon Sep 28 10:34:30 EDT 2009
Andy,Thanks for the response. This helps a lot!
On Mon, Sep 28, 2009 at 7:28 AM, Andy Robinson <andy at reportlab.com> wrote:
> 2009/9/27 Troy Caldwell <troy.caldwell at covchurch.org>:
> > I realize that if I place the chart at 0,0, my labels for both axes will
> > outside the bounds of the drawing. They appear, but they appear where I
> > don't want them. I'm trying to figure out a way to calculate the width
> > the y axis, and the height of the x axis so I can then make the decision
> > where to place the chart itself to keep the entire image where I want it.
> The framework was designed for people using these charts within
> financial publications, alongside other tables and content. Often
> you want to stack up several charts above each other and be sure all
> the categories line up from one chart to the next. Therefore, we
> decided to make the inner 'plot rectangle' explicit (and this is what
> x,y,width and height refer to in each chart class). A consequence
> of this is that it's your job to allow enough space for the axis
> labels, which of course depends on the typical length of the text in
> those labels, and the font size and position you specify.
> This might need one or two tries at 'design time' but I can't see why
> you'd need to redo it for a lot of chart instances.
> If you need to know the precise size, every shape (including the
> charts) has a method called 'getBounds' which will return its actual
> size, including any text labels off the edge of the axis. This would
> let you set things up exactly right, at the expense of basically
> drawing things twice.
> Best Regards,
> Andy Robinson
> CEO/Chief Architect
> ReportLab Europe Ltd.
> Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK
> Tel +44-20-8545-1570
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the reportlab-users