don't generate all the graphs at once

This commit is contained in:
Damien Elmes 2011-03-26 16:51:26 +09:00
parent 28191cde45
commit 457b0f5c73

View file

@ -25,17 +25,25 @@ class Graphs(object):
self._stats = None self._stats = None
self.selective = selective self.selective = selective
def report(self): def report(self, type=0):
txt = (self.dueGraph(0, 30, _("Due/Day")) + # 0=days, 1=weeks, 2=months
self.dueGraph(0, 52, _("Due/Week"), chunk=7) + fc = _("Forecast")
self.dueGraph(0, None, _("Due/Month"), chunk=30) + rc = _("Review Count")
self.repsGraph(30, _("Reviewed/Day"), _("Time/Day")) + rt = _("Review Time")
self.repsGraph(52, _("Reviewed/Week"), _("Time/Week"), txt = ""
chunk=7) + # period-dependent graphs
self.repsGraph(None, _("Reviewed/Month"), _("Time/Month"), if type == 0:
chunk=30) + txt += self.dueGraph(0, 30, fc)
self.ivlGraph() + txt += self.repsGraph(30, rc, rt)
self.easeGraph()) elif type == 1:
txt += self.dueGraph(0, 52, fc, chunk=7)
txt += self.repsGraph(52, rc, rt, chunk=7)
else:
txt += self.dueGraph(0, None, fc, chunk=30)
txt += self.repsGraph(None, rc, rt, chunk=30)
# other graphs
txt += self.ivlGraph()
txt += self.easeGraph()
return "<script>%s</script><center>%s</center>" % (anki.js.all, txt) return "<script>%s</script><center>%s</center>" % (anki.js.all, txt)
# Due and cumulative due # Due and cumulative due