From ceb342cbc2ee280399b5d5e540a442e67ad73f52 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 10 Aug 2020 13:56:16 +1000 Subject: [PATCH] fix "32 of 31 days" https://forums.ankiweb.net/t/feedback-on-the-new-graphs-in-anki-ankimobile/1671/41?u=dae --- ts/src/stats/reviews.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ts/src/stats/reviews.ts b/ts/src/stats/reviews.ts index d5b295c88..022411a6b 100644 --- a/ts/src/stats/reviews.ts +++ b/ts/src/stats/reviews.ts @@ -117,13 +117,13 @@ export function renderReviews( // cap max to selected range switch (range) { case GraphRange.Month: - xMin = -31; + xMin = -30; break; case GraphRange.ThreeMonths: - xMin = -90; + xMin = -89; break; case GraphRange.Year: - xMin = -365; + xMin = -364; break; case GraphRange.AllTime: xMin = min(sourceData.reviewCount.keys())!; @@ -354,7 +354,7 @@ export function renderReviews( }) .on("mouseout", hideTooltip); - const periodDays = -xMin; + const periodDays = -xMin + 1; const studiedDays = sum(bins, (bin) => bin.length); const total = yCumMax; const periodAvg = total / periodDays;