From 1162a8feb5ff56527a8b432b8874c1e4c5e78244 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 7 Jul 2020 11:39:58 +1000 Subject: [PATCH] fix card count graph https://forums.ankiweb.net/t/anki-2-1-28-beta/629/24 --- ts/src/stats/card-counts.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ts/src/stats/card-counts.ts b/ts/src/stats/card-counts.ts index ed4ed0055..9dff8bd9a 100644 --- a/ts/src/stats/card-counts.ts +++ b/ts/src/stats/card-counts.ts @@ -115,10 +115,10 @@ export function renderCards( showTooltip(tooltipText(d), x, y); }) .transition(trans) - .attr("width", (d) => x(d.total)); + .attr("x", (d) => x(d.total - d.count[1])) + .attr("width", (d) => x(d.count[1]) - x(0)); }; - data.reverse(); svg.select("g.days") .selectAll("rect") .data(data) @@ -127,7 +127,6 @@ export function renderCards( enter .append("rect") .attr("height", 10) - .attr("x", x(0)) .attr("y", bounds.marginTop) .attr("fill", (d: any): any => { switch (d.idx) {