[reportlab-users] linecharts background
Dirk Datzert
reportlab-users@reportlab.com
Wed, 31 Jul 2002 13:02:49 +0200
Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------F0BA62C18DD70B1EF501263B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
I applied the background shape patch for barcharts now for linecharts.
Propably it will made it into the CVS ?
Regards,
Dirk
--------------F0BA62C18DD70B1EF501263B
Content-Type: text/plain; charset=us-ascii;
name="linecharts.background.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="linecharts.background.diff"
--- linecharts.py.orig Wed Jul 31 12:50:59 2002
+++ linecharts.py Wed Jul 31 12:54:34 2002
@@ -112,6 +112,8 @@
desc='List of category names.'),
data = AttrMapValue(None,
desc='Data to be plotted, list of (lists of) numbers.'),
+ background = AttrMapValue(None,
+ desc='Handle to backgroupd shape'),
)
def __init__(self):
@@ -162,6 +164,9 @@
# New line chart attributes.
self.joinedLines = 1 # Connect items with straight lines.
+ # no default background shape
+ self.background = None
+
def demo(self):
"""Shows basic use of a line chart."""
@@ -250,8 +255,18 @@
def makeBackground(self):
+
g = Group()
+ if self.background is not None:
+ bg = self.background
+ bg.x = self.x
+ bg.y = self.y
+ bg.width = self.width
+ bg.height = self.height
+ g.add(bg)
+
+ else:
g.add(Rect(self.x, self.y,
self.width, self.height,
strokeColor = self.strokeColor,
--------------F0BA62C18DD70B1EF501263B--