From 54668eb0f15c1c58968f3bc7aa06cf2d9c89ddba Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sun, 24 Apr 2022 10:19:18 -0700 Subject: [PATCH] Always draw all the way to the right. This probably makes more sense to people. --- static/chart.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/chart.mjs b/static/chart.mjs index 2fbfc8a..16f6314 100644 --- a/static/chart.mjs +++ b/static/chart.mjs @@ -66,7 +66,7 @@ class HistoryChart { let y = 0 this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height) - + this.ctx.moveTo(0, y) this.ctx.beginPath() for (let point of this.data) { @@ -75,6 +75,7 @@ class HistoryChart { y = point[1] * this.canvas.height this.ctx.lineTo(x, y) } + this.ctx.lineTo(this.canvas.width, y) this.ctx.stroke() requestAnimationFrame(() => this.draw())