diff --git a/anki/graphs.py b/anki/graphs.py
index d5eb487d9..b08bebddd 100644
--- a/anki/graphs.py
+++ b/anki/graphs.py
@@ -67,8 +67,10 @@ class Graphs(object):
data.append(
dict(data=totd, color=colCum, label=_("Cumulative"), yaxis=2,
bars={'show': False}, lines=dict(show=True), stack=False))
- txt = self._graph(id="due", title=_("Forecast"), data=data,
- info=_("The number of reviews due in the future."), conf=dict(
+ txt = self._title(
+ _("Forecast"),
+ _("The number of reviews due in the future."))
+ txt += self._graph(id="due", data=data, conf=dict(
xaxis=dict(tickDecimals=0),
yaxes=[dict(), dict(tickDecimals=0, position="right")]))
return txt
@@ -114,9 +116,9 @@ group by day order by day""" % (self._limit(), lim),
yaxes=[dict(), dict(position="right")])
if days is not None:
conf['xaxis']['min'] = -days
- def plot(id, title, data, ylabel, info):
- return self._graph(id, title=title,
- data=data, conf=conf, ylabel=ylabel, info=info)
+ def plot(id, data, ylabel):
+ return self._graph(
+ id, data=data, conf=conf, ylabel=ylabel)
# reps
(repdata, repsum) = self._splitRepData(d, (
(3, colMature, _("Mature")),
@@ -124,8 +126,9 @@ group by day order by day""" % (self._limit(), lim),
(4, colRelearn, _("Relearn")),
(1, colLearn, _("Learn")),
(5, colCram, _("Cram"))))
- txt = plot("reps", reptitle, repdata, ylabel=_("Answers"),
- info=_("The number of questions you have answered."))
+ txt = self._title(
+ reptitle, _("The number of questions you have answered."))
+ txt += plot("reps", repdata, ylabel=_("Answers"))
# time
(timdata, timsum) = self._splitRepData(d, (
(8, colMature, _("Mature")),
@@ -137,8 +140,8 @@ group by day order by day""" % (self._limit(), lim),
t = _("Minutes")
else:
t = _("Hours")
- txt += plot("time", timetitle, timdata, ylabel=t, info=_(
- "The time taken to answer the questions."))
+ txt += self._title(timetitle, _("The time taken to answer the questions."))
+ txt += plot("time", timdata, ylabel=t)
return txt
def _ansInfo(self, data):
@@ -210,13 +213,14 @@ group by day order by day""" % lim,
for (grp, cnt) in ivls:
tot += cnt
totd.append((grp, tot/float(all)*100))
- txt = self._graph(id="ivl", title=_("Intervals"), data=[
+ txt = self._title(_("Intervals"),
+ _("Delays until reviews are shown again."))
+ txt += self._graph(id="ivl", data=[
dict(data=ivls, color=colIvl, label=_("All Types")),
dict(data=totd, color=colCum, label=_("% Total"), yaxis=2,
bars={'show': False}, lines=dict(show=True), stack=False)
], conf=dict(
- yaxes=[dict(), dict(position="right", max=105)]),
- info=_("Delays until reviews are shown again."))
+ yaxes=[dict(), dict(position="right", max=105)]))
txt += _("Average interval: %s") % fmtTimeSpan(avg*86400)
txt += "
" + _("Longest interval: %s") % fmtTimeSpan(max*86400)
return txt
@@ -237,57 +241,6 @@ order by grp""" % (self._limit(), lim), chunk=chunk)]
select count(), avg(ivl), max(ivl) from cards where queue = 2 %s""" %
self._limit()))
- # Intervals
- ######################################################################
-
- def cardGraph(self):
- # graph data
- div = self._cards()
- d = []
- for c, (t, col) in enumerate((
- (_("Mature"), colMature),
- (_("Young+Learn"), colYoung),
- (_("Unseen"), colUnseen))):
- d.append(dict(data=div[c], label=t, color=col))
- # text data
- i = []
- self._line(i, _("Total Cards"), self.deck.cardCount())
- self._line(i, _("Total Facts"), self.deck.factCount())
- (low, avg, high) = self._factors()
- self._line(i, _("Lowest ease factor"), "%d%%" % low)
- self._line(i, _("Average ease factor"), "%d%%" % avg)
- self._line(i, _("Highest ease factor"), "%d%%" % high)
- info = "
" - info += _('''\ -A card's ease factor is the size of the next interval \ -when you answer "good" on a review.''') - txt = "
%s | %s |
" + info += _('''\ +A card's ease factor is the size of the next interval \ +when you answer "good" on a review.''') + txt = self._title(_("Cards Types"), + _("The division of cards in your deck.")) + txt += "
%s | %s |
%(ylab)s |
-
|