"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/test_graphics_charts.py" between
reportlab-3.5.65.tar.gz and reportlab-3.5.66.tar.gz

About: ReportLab generates high-quality dynamic PDF documents/charts in real-time & high volumes from any data source (commercial version also available). f: office t: PDF report "data graphics" charts

test_graphics_charts.py  (reportlab-3.5.65):test_graphics_charts.py  (reportlab-3.5.66)
skipping to change at line 110 skipping to change at line 110
catNames = [n+'-99' for n in catNames] catNames = [n+'-99' for n in catNames]
bc.categoryAxis.categoryNames = catNames bc.categoryAxis.categoryNames = catNames
drawing.add(bc) drawing.add(bc)
return drawing return drawing
def sample2bar(data=[(13, 5, 20, 22, 37, 45, 19, 4), def sample2bar(data=[(13, 5, 20, 22, 37, 45, 19, 4),
(14, 6, 21, 23, 38, 46, 20, 5)]): (14, 6, 21, 23, 38, 46, 20, 5)]):
return sample1bar(data) return sample1bar(data)
def sample1barline(
data=[(100,110,120,130),(70,25,85,30),(63,75,51,92),(51,21,66,71),(10,11
,90,30)],
seriesOrder=[[0,3,1],[4],[2]],
lines=[3,4],
cAStyle = 'mixed',
):
d = Drawing(400,250)
chart = VerticalBarChart()
d.add(chart,name='chart')
leg = Legend()
d.add(leg, name='leg')
chart.bars.strokeColor = None
chart.bars[2].fillColor = colors.blue
chart.bars[3].fillColor = colors.orange
chart.bars[4].fillColor = colors.black#yellow
chart.bars[4].strokeWidth = 3
chart.bars[4].symbol = makeMarker('FilledDiamond',size=10,fillColor=colo
rs.red)
chart.barSpacing = 1
chart.categoryAxis.style=cAStyle
chart.data = data
chart.x = 20
chart.y = 70
chart.height = d.height - chart.y -10
chart.valueAxis.forceZero = True
chart.width = d.width-chart.x - 10
for i in lines: chart.bars[i].isLine=1
for i in lines: chart.bars[i].strokeWidth = 2
leg.colorNamePairs = Auto(chart=chart)
leg.x = d.width / 2
leg.y = 5
leg.boxAnchor = 's'
leg.columnMaximum = 1
leg.alignment='right'
return d
def sample1line(data=[(13, 5, 20, 22, 37, 45, 19, 4)]): def sample1line(data=[(13, 5, 20, 22, 37, 45, 19, 4)]):
drawing = Drawing(400, 200) drawing = Drawing(400, 200)
bc = HorizontalLineChart() bc = HorizontalLineChart()
bc.x = 50 bc.x = 50
bc.y = 50 bc.y = 50
bc.height = 125 bc.height = 125
bc.width = 300 bc.width = 300
bc.data = data bc.data = data
skipping to change at line 315 skipping to change at line 350
cls.story.append(Paragraph('Tests for chart classes', h1)) cls.story.append(Paragraph('Tests for chart classes', h1))
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):
"Hook method for deconstructing the test fixture after testing it." "Hook method for deconstructing the test fixture after testing it."
path=outputfile('test_graphics_charts.pdf') path=outputfile('test_graphics_charts.pdf')
doc = MyDocTemplate(path) doc = MyDocTemplate(path)
doc.build(cls.story) doc.build(cls.story)
global fontName
fontName = 'Helvetica'
run_samples([(k,v,'special') for k,v in globals().items() if k.lower().s
tartswith('sample')
or k in ('lpleg', 'hlcleg', 'bcleg', 'pcleg', 'scleg
', 'plpleg')
])
def test0(self): def test0(self):
"Test bar charts." "Test bar charts."
story = self.story story = self.story
story.append(Paragraph('Single data row', h2)) story.append(Paragraph('Single data row', h2))
story.append(Spacer(0, 0.5*cm)) story.append(Spacer(0, 0.5*cm))
drawing = sample1bar() drawing = sample1bar()
story.append(drawing) story.append(drawing)
story.append(Spacer(0, 1*cm)) story.append(Spacer(0, 1*cm))
story.append(Paragraph('Multiple series mixed bar style with lines', h2)
)
story.append(Spacer(0, 0.5*cm))
drawing = sample1barline()
story.append(drawing)
story.append(Spacer(0, 1*cm))
def test1(self): def test1(self):
"Test bar charts." "Test bar charts."
story = self.story story = self.story
story.append(Paragraph('Double data row', h2)) story.append(Paragraph('Double data row', h2))
story.append(Spacer(0, 0.5*cm)) story.append(Spacer(0, 0.5*cm))
drawing = sample2bar() drawing = sample2bar()
story.append(drawing) story.append(drawing)
 End of changes. 3 change blocks. 
0 lines changed or deleted 52 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)