added a legend to the reviews graph.

This commit is contained in:
Timo Paulssen 2008-12-13 18:39:36 +01:00
parent 9c1f76cf57
commit ec401210fd

View file

@ -133,8 +133,20 @@ from stats""")
args = sum((self.unzip(self.stats[type].items(), limit=days, reverseLimit=True) for type in ["dayRepsMature", "dayRepsYoung", "dayRepsNew"]), [])
self.filledGraph(graph, days, ["#7777ff", "#77ffff", "#ff7777"], *args)
cheat = fig.add_subplot(111)
b1 = cheat.bar(-3, 0, color = "#ff7777")
b2 = cheat.bar(-4, 0, color = "#77ffff")
b3 = cheat.bar(-5, 0, color = "#7777ff")
cheat.legend([b1, b2, b3], [
_("New"),
_("Young"),
_("Mature")], loc='upper left')
graph.set_xlim(xmin=-days, xmax=0)
graph.set_ylim(ymax=max(max(a for a in args[1::2])) + 10)
return fig
def cumulativeDue(self, days=30):