Sergey - 2006-08-27

The following is the most trivial code to plot a Scrum burndown chart, where every "leaf" task is considered a story, and all stories are equal in difficulty. Hopefully somebody finds it useful.

class PlotBurndown(charts.TimeAxisPlotChart):
calendar = project.calendar

def create_plot(self, to_x):
    _stories = filter(lambda t: not t.children, project)
    _stories = sorted(_stories, key = lambda t: t.end)
    _total = len(_stories)
    _dates = [to_x(project.start)]
    _left = [_total]
    for t in _stories:
        _total -= 1
        _x = to_x(t.end)
        if _dates[-1] == _x:
            _left[-1] = _total
        else:
            _dates.append(_x)
            _left.append(_total)

    plot(_dates, _left)