[reportlab-users] Five issues with AreaLinePlot

meitham meitham at reportlab.com
Fri Nov 6 05:16:08 EST 2009



> I've identified five issues with LineAreaPlots and attach sample

> code and output illustrating these. Here's a list from the code:

>

> # issue 1: gridline appears on top border, but not on bottom

> # border: (ideally, it should not appear on any borders)

>

The grid lines are actually appearing on both top and bottom border,
however the bottom grid line is overwritten with the x axis since you
set chart.gridFirst=True. If you set set the
chart.xValueAxis.visible=False you will be able to see the gridLine on
the bottom. This is not a bug.


> # issue 2: right borderline (red) is overpainted by chart areas:

>

chart.stroke was never intended to be used as a chart border. The
property is there as a consequence of architectural inheritance.
Hopefully this property will disappear in reportlab 3.0 with the use of
meta classes.

If you want to draw a border around your chart you can draw a rectangle.
from reportlab.graphics.shapes import Rect
drawing.background = Rect(chart.x,chart.y, chart.width,
chart.height,strokeColor=red,fillColor=None)


> # issue 3: True/False has no effect (grid is always on top):

>

The effect of chart.gridFirst is whether the the grid should be drawn
before the axis or after, not before the chart (area chart in your
example). There are two similar properties to achieve that on the axises
chart.xValueAxis.drawGridLast and chart.yValueAxis.drawGridLast. The
only way to solve this is by adding a Z axis (depth) where chart
components can have different values on that axis which controls the
order of drawing.



> # issue 4: True/False has no effect (labels are always shown,

> # if lineLabelFormat != None):

>

This bug has been fixed.


> # issue 5: label format cannot be a callable:

> # chart.lineLabelFormat = lambda val:"%s" % ("i" * val)

>

This bug has been fixed.

Best regards
Meitham


More information about the reportlab-users mailing list