mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
addded cumulative graph on main screen
saving code; but will revert
This commit is contained in:
parent
3b23275204
commit
d6275d94c5
1 changed files with 12 additions and 3 deletions
|
@ -94,9 +94,11 @@ $(function () {
|
|||
var d = %(fcdata)s;
|
||||
if (d) {
|
||||
$.plot($("#placeholder"), [
|
||||
{ data: d, bars: { show: true, barWidth: 0.8 }, color: "#0c0" }
|
||||
{ data: d[0], bars: { show: true, barWidth: 0.8, align:"center" }, color: "#0c0"},
|
||||
{ data: d[1], color: "#000", lines: { show: true }, yaxis: 2 }
|
||||
], {
|
||||
xaxis: { ticks: [[0.4, "Today"]] }
|
||||
xaxis: { ticks: [[0, "Today"], [6, "7 days"], [13, "14 days"]] },
|
||||
yaxes: [{}, {position: "right"}]
|
||||
});
|
||||
} else {
|
||||
$("#placeholder").hide();
|
||||
|
@ -167,7 +169,14 @@ $(function () {
|
|||
fc = self.mw.deck.sched.dueForecast(14)
|
||||
if not sum(fc):
|
||||
return "''"
|
||||
return simplejson.dumps(tuple(enumerate(fc)))
|
||||
tot = 0
|
||||
repd = []
|
||||
totd = []
|
||||
for (c, cnt) in enumerate(fc):
|
||||
tot += cnt
|
||||
repd.append((c, cnt))
|
||||
totd.append((c, tot))
|
||||
return simplejson.dumps([repd, totd])
|
||||
|
||||
# Toolbar
|
||||
##########################################################################
|
||||
|
|
Loading…
Reference in a new issue