[reportlab-users] get all values of data points above the line chart

Helga Peters helga at full-control.nl
Tue Feb 11 06:18:44 EST 2014


Hello,

Currently I am working on a mixed chart. Below find the first part of my
chart:

drawing = Drawing(250, 175)
data = [ (3,3,3,10,14,1,1,1,11,13,12,7) ] # total

lc = HorizontalLineChart()
lc.x = 40
lc.y = -175
lc.height = 225
lc.width = 610
lc.data = data
lc.joinedLines = 1
lc.inFill = 1

lc.categoryAxis.categoryNames =
['0:00','2:00','4:00','6:00','8:00','10:00','12:00','14:00','16:00','18:00','20:00','22:00']
lc.valueAxis.valueMin = 0
lc.valueAxis.valueMax = 15
lc.lineLabelFormat = '%0.0f'
lc.lineLabelNudge = 2
lc.lines[0].strokeColor= colors.beige
drawing.add(lc)

Since I would like to add the below part, the values of the above part
should all stand above the line to be visible. I tried to play with
'lineLabelNudge', but the best I can do is to make them all half visible.
Do you have any suggestions of how to solve that ?
Thansks in advance,
Helga


data3=[ (0,0,0,2,7,0,1,1,7,5,6,2), # task1
(0,0,0,5,5,0,0,0,0,0,0,1), # task2
(0,0,0,0,0,0,0,0,2,6,4,1), # task3
(1,1,1,1,1,0,0,0,1,1,1,1), # task4
(1,1,1,1,1,0,0,0,1,1,0,1), # task5
(0,1,1,0,0,0,0,0,0,0,0,1), # task6
(0,0,0,1,0,1,0,0,0,0,1,0) # task7
]
bc = VerticalBarChart()
bc.x = lc.x
bc.y = lc.y
bc.height = lc.height
bc.width = lc.width
bc.data = data3
bc.categoryAxis.style = 'stacked'
bc.valueAxis.valueMin = 0
bc.valueAxis.valueMax = lc.valueAxis.valueMax
bc.categoryAxis.visibleAxis =0
bc.categoryAxis.categoryNames = None
drawing.add(bc)


--
Met vriendelijke groet,
Helga Peters
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20140211/98a52920/attachment.htm>


More information about the reportlab-users mailing list