Always draw all the way to the right.

This probably makes more sense to people.
This commit is contained in:
Neale Pickett 2022-04-24 10:19:18 -07:00
parent 125579ec70
commit 54668eb0f1
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,7 @@ class HistoryChart {
let y = 0 let y = 0
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height) this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)
this.ctx.moveTo(0, y) this.ctx.moveTo(0, y)
this.ctx.beginPath() this.ctx.beginPath()
for (let point of this.data) { for (let point of this.data) {
@ -75,6 +75,7 @@ class HistoryChart {
y = point[1] * this.canvas.height y = point[1] * this.canvas.height
this.ctx.lineTo(x, y) this.ctx.lineTo(x, y)
} }
this.ctx.lineTo(this.canvas.width, y)
this.ctx.stroke() this.ctx.stroke()
requestAnimationFrame(() => this.draw()) requestAnimationFrame(() => this.draw())