The following script, which started out life as the roudnup-reminder script, will generate a pie chart summary of the statuses in your tracker. It uses the PyChart library to do the actual charting. The script is:
#! /usr/bin/env python
import sys
from pychart import *
from roundup import instance
# open the instance
if len(sys.argv) != 2:
print 'You need to specify an instance home dir'
instance_home = sys.argv[1]
instance = instance.open(instance_home)
db = instance.open('admin')
# analyse the tracker for the status summary
data = []
for sid in db.status.list():
count = len(db.issue.find(status=sid))
if count:
data.append((db.status.get(sid, 'name'), count))
# now call PyChart for the chart generation
theme.output_file = 'out.png'
theme.reinitialize()
ar = area.T(size=(150,150), legend=legend.T(),
x_grid_style=None, y_grid_style=None)
plot = pie_plot.T(data=data, arc_offsets=[0,10,0,10],
shadow=(2, -2, fill_style.gray50), label_offset=25, arrow_style=arrow.a3)
ar.add_plot(plot)
ar.draw()
the resulting "out.png" looks like:
