reportlab error

Walid Bouazizi <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <CAAKOCMZLPq8RDJMcgfZjfY7ipT3aUf=jN4s=Wi1-p9Y1CMPuYw@mail.gmail.com>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.