html>
I have been able to create graph of 2 axis in ReportLab by overlapping a bitrate and linepoint. Here are some similar to a code to be interested in:
import drawings from reportlab.graphics.shapes, color makeMarker reportlab.graphics.charts from reportlab.graphics.widgets.markers. VerticalBarChart LinePlot drawing import import reportlab.graphics.charts.lineplots from barcharts import = drawing (400, 200) data = [(13, 5, 20, 22, 37, 45, 19, 4)] noOfBars = len (data [ 0]) BC = VerticalBarChart () bc.x = 50 bc.y = 50 bc.height = 125 bc.width = 300 bc.data = data bc.valueAxis.valueMin = 0 bc.valueAxis.valueMax = 50 bc.categoryAxis .categoryNames = ['Jan-99', 'Feb-99', 'March-99', 'April-99', 'May-99', 'Jun-99', 'Jul-99', 'August-99 '] Drawing joint (BC) date 3 = [[(0.5, 4), (1.5, 3), (2.5, 4), (3.5, 6), (4.5, 4), (5.5, 2), (6.5, 5) (7.5, 6) ]] L.P. = Lineplot () Lpkksh = Bskksh Lpky = Bsky Lpkhait = Bskhait Lpkvidth = Bskvidth Lpkdeta = Dt3 Lpkjoinedlines = 1 Lpklains [0] Ksinbl = makeMarker ( 'Circle') lp.lines [0] .strokeColor = colors.blue lp.lineLabelFormat = '% 2.0' lp.xValueAxis.valueMin = 0 lp.xValueAxis.valueMax = noOfBars lp.yValueAxis.valueMin = 0 lp. YValueAxis.valueMax = 8 lp.xValueAxis.visible = False lp.yValueAxis.visible = False #Hide 2nd plot its Yaxis drawing.add (LP) y2Axis = YValueAxis () # 2 Yaxis replication in y2Axis.setProperties (lp.yValueAxis .getProperties ()) y2Axis.setPosition (lp.x + lp.width, lp.y, lp.height) y2Axis.tickRight = 5 y2Axis.tickLeft = 0 y2Axis.configure (data3) y2Axis.visible = true drawing.add ( Y2Axis) renderPDF.drawToFile (drawing, '../tmp/barline.pdf')
The only problem is that the label of 2 Pointing inside of F. I would like them to be a graph!
Thanks in advance
I have done this recently
y2Axis.labels.dx = 10
Should do the trick for you.