I am using Reportlab to create some graphs in my PDF reports. I was creating an Area Line Plot and got stuck at a point where I am not able to understand why am I not getting the output I would like to see.
Here is the code I had written for my output:
def standardLinePlot(data, width=200, height=200):
d = Drawing(width, height)
lp = AreaLinePlot()
lp.width, lp.height = width, height
lp.xValueAxis.valueMin = 0
lp.xValueAxis.valueSteps = [0,6,12,18,24,30,36]
lp.yValueAxis.valueMin = 0
lp.reversePlotOrder = False
To define the color for the lines it seems you need to access... well, the lines :). So,
lp.lines.strokeColor = colors.grey instead of
lp.strokeColor = colors.grey, as that one goes for the plot background color!
The question about the labels is a bit more tricky, though...
ScatterPlot includes functionality to set labels for X and Y axis, but that's not the case for
AreaLinePlot. Of course, you could derive a class from
AreaLinePlot copying that functionality, if you're going to use it often.