Changeset 33
- Timestamp:
- 10/17/07 11:18:09 (5 years ago)
- Location:
- trunk/examples
- Files:
-
- 2 added
- 1 removed
- 1 modified
-
barchart.png (deleted)
-
barchart.py (modified) (3 diffs)
-
hbarchart.png (added)
-
vbarchart.png (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/barchart.py
r32 r33 24 24 from lines import lines 25 25 26 def barChart(output ):26 def barChart(output, chartFactory): 27 27 surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 400, 200) 28 28 … … 49 49 }, 50 50 'padding': { 51 'left': 4051 'left': 55 52 52 } 53 53 } 54 chart = pycha.bar.VerticalBarChart(surface, options)54 chart = chartFactory(surface, options) 55 55 56 56 chart.addDataset(dataSet) … … 61 61 if __name__ == '__main__': 62 62 output = sys.argv[1] if len(sys.argv) > 1 else 'barchart.png' 63 barChart(output) 63 barChart('v' + output, pycha.bar.VerticalBarChart) 64 barChart('h' + output, pycha.bar.HorizontalBarChart)
