[reportlab-users] reportlab error

Walid Bouazizi bouazizi.walid at gmail.com
Tue Aug 27 05:59:55 EDT 2013


Hi,
I have this piece of code that gives the following error

please help me



from reportlab.graphics.shapes import Drawing
from reportlab.graphics.charts.barcharts import VerticalBarChart
from reportlab.graphics import renderPM

d = Drawing(300, 200)

chart = VerticalBarChart()
chart.width = 260
chart.height = 160
chart.x = 20
chart.y = 20
chart.data = [[1,2], [3,4]]
chart.categoryAxis.categoryNames = ['foo', 'bar']
chart.valueAxis.valueMin = 0

d.add(chart)
#d.save(fnRoot='test', formats=['png', 'pdf'])
renderPM.drawToFile(d, 'example.png', 'PNG')


File "reportlab\graphics\renderPM.pyo", line 651, in drawToFile
File "reportlab\graphics\renderPM.pyo", line 637, in drawToPMCanvas
File "reportlab\graphics\renderPM.pyo", line 50, in draw
File "reportlab\graphics\renderbase.pyo", line 198, in draw
File "reportlab\graphics\renderPM.pyo", line 93, in initState
File "reportlab\graphics\renderPM.pyo", line 87, in applyState
File "reportlab\graphics\renderPM.pyo", line 368, in setFont
File "reportlab\graphics\renderPM.pyo", line 221, in _setFont
RenderPMError: Can't setFont(Times-Roman) missing the T1 files?
Originally <type 'exceptions.TypeError'>: makeT1Font() argument 2 must be
string, not None
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20130827/29995a2e/attachment.html>


More information about the reportlab-users mailing list