From 80fad05f231545907f9d5f3dca2ee16a4855fedf Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 3 May 2023 23:37:02 +0000 Subject: [PATCH] Show latest value on the spark line graphs. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4283 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/client.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/client.js b/core/client.js index 52d66d8a..69faaf48 100644 --- a/core/client.js +++ b/core/client.js @@ -313,9 +313,11 @@ class TfSparkLineElement extends LitElement { } render() { + let max = Math.round(10.0 * Math.max(...this.lines.map(line => line.values[line.values.length - 1]))) / 10.0; return html` ${this.lines.map(x => this.render_line(x))} + ${max} `; }