tests/test_graphics_charts.py
branchpy33
changeset 4056 be1be82d76fa
parent 3794 398ea04239b5
child 4239 75c7de3058a6
equal deleted inserted replaced
4055:39186be8447c 4056:be1be82d76fa
    14 from reportlab.lib.pagesizes import A4
    14 from reportlab.lib.pagesizes import A4
    15 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
    15 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
    16 from reportlab.lib.validators import Auto
    16 from reportlab.lib.validators import Auto
    17 from reportlab.pdfgen.canvas import Canvas
    17 from reportlab.pdfgen.canvas import Canvas
    18 from reportlab.graphics.shapes import *
    18 from reportlab.graphics.shapes import *
    19 from reportlab.graphics.charts.textlabels import Label
    19 from reportlab.graphics.charts.textlabels import Label, _text2Path
    20 from reportlab.platypus.flowables import Spacer, PageBreak
    20 from reportlab.platypus.flowables import Spacer, PageBreak
    21 from reportlab.platypus.paragraph import Paragraph
    21 from reportlab.platypus.paragraph import Paragraph
    22 from reportlab.platypus.xpreformatted import XPreformatted
    22 from reportlab.platypus.xpreformatted import XPreformatted
    23 from reportlab.platypus.frames import Frame
    23 from reportlab.platypus.frames import Frame
    24 from reportlab.platypus.doctemplate import PageTemplate, BaseDocTemplate
    24 from reportlab.platypus.doctemplate import PageTemplate, BaseDocTemplate
   410         story.append(Spacer(0,0.5*cm))
   410         story.append(Spacer(0,0.5*cm))
   411         drawing8 = sample8()
   411         drawing8 = sample8()
   412         story.append(drawing8)
   412         story.append(drawing8)
   413         story.append(Spacer(0,1*cm))
   413         story.append(Spacer(0,1*cm))
   414 
   414 
       
   415     def test8(self):
       
   416         '''text _text2Path'''
       
   417         story = self.story
       
   418         story.append(Paragraph('Texts drawn using a Path', h3))
       
   419         story.append(Spacer(0,0.5*cm))
       
   420         P=_text2Path('Hello World from font Times-Roman!',x=10,y=20,fontName='Times-Roman',fontSize=20,strokeColor=colors.blue,strokeWidth=0.1,fillColor=colors.red)
       
   421         d = Drawing(400,50)
       
   422         d.add(P)
       
   423         story.append(d)
       
   424         P=_text2Path('Hello World from font Helvetica!',x=10,y=20,fontName='Helvetica',fontSize=20,strokeColor=colors.blue,strokeWidth=0.1,fillColor=colors.red)
       
   425         d = Drawing(400,50)
       
   426         d.add(P)
       
   427         story.append(d)
       
   428         story.append(Spacer(0,1*cm))
       
   429 
   415 
   430 
   416     def test999(self):
   431     def test999(self):
   417         #keep this last
   432         #keep this last
   418         from reportlab.graphics.charts.piecharts import Pie, _makeSideArcDefs, intervalIntersection
   433         from reportlab.graphics.charts.piecharts import Pie, _makeSideArcDefs, intervalIntersection
   419         L = []
   434         L = []