[reportlab-users] legends and backgrounds

Robin Becker reportlab-users@reportlab.com
Thu, 1 Aug 2002 19:44:26 +0100


In article <3D496C92.D2FD8877@rasselstein-hoesch.de>, Dirk Datzert
<dirk.datzert@tks-rasselstein.thyssenkrupp.com> writes
>Hi,
>
>I thought some minutes about the PlotArea as backgrounds for charts and
>then:
>a similar interface would be nice for Legends too. Think of a legend
>which is displayed on a ShadedRect() background chart. Than it would be
>nice to create a uni-color background for the legend cause it will be
>better to read.
>
>Since this will no longer a PlotArea it seams to me that this would be a
>more general BackgroundArea.
>
>Any comments ?
>
>Regads,
>Dirk
well if we go on like this it would seem that all things will end up
with a background option and an additional step will be required in the
draw method. So before we go rushing off what other things could have a
background? Also is the current PlotArea sufficient/right? It won't cope
with the case when the object already has strokeColor/fillColor for
other reasons. The Label object has boxFillColor, boxStrokeColor,
boxStrokeWidth etc to handle filling of the background.

At present I think that Groups have a getContents method which is used
to determine the contents of a Group/Drawing. If the instance has
something called a background then that thing is returned first as part
of the contents. Unfortunately since groups don't have a size it's hard
to allow the getContents thing to automatically configure the
background. This mechanism is because for some reason Groups don't have
a draw that the renderers can use. Drawings have a draw method, but that
relates to their use as a flowable.
-- 
Robin Becker