Clean up code

This commit is contained in:
Jian Li 2019-03-10 18:20:08 -07:00
parent c4f9a35af4
commit 08e51f220f

View file

@ -240,10 +240,13 @@ from revlog where id > ? """+lim, (self.col.sched.dayCutoff-86400)*1000)
xaxis = dict(tickDecimals=0, min=-0.5)
if end is not None:
xaxis['max'] = end-0.5
txt += self._graph(id="due", data=data, xunit=chunk,
ylabel2=_("Cumulative Cards"), conf=dict(
xaxis=xaxis, yaxes=[dict(min=0), dict(
min=0, tickDecimals=0, position="right")]))
txt += self._graph(
id="due", data=data, xunit=chunk, ylabel2=_("Cumulative Cards"),
conf=dict(
xaxis=xaxis, yaxes=[
dict(min=0), dict(min=0, tickDecimals=0, position="right")]
),
)
txt += self._dueInfo(tot, len(totd)*chunk)
return txt
@ -293,7 +296,7 @@ group by day order by day""" % (self._limit(), lim),
return self._graph(
id, data=data, conf=conf, xunit=chunk, ylabel=ylabel, ylabel2=ylabel2)
# graph
(repdata, repsum) = self._splitRepData(data, ((1, colLearn, ""),))
repdata, repsum = self._splitRepData(data, ((1, colLearn, ""),))
txt = self._title(
_("Added"), _("The number of new cards you have added."))
txt += plot("intro", repdata, ylabel=_("Cards"), ylabel2=_("Cumulative Cards"))
@ -407,7 +410,6 @@ group by day order by day""" % (self._limit(), lim),
for (n, col, lab) in spec:
totcnt[n] = 0
totd[n] = []
sum = []
for row in data:
for (n, col, lab) in spec:
if n not in sep:
@ -836,8 +838,6 @@ from cards where did in %s""" % self._limit())
opacity=0.5,
color="#000"
)))
#conf['legend'] = dict(show=False)
return (
"""
<table cellpadding=0 cellspacing=10>