From e611b21d80905bc33a7704cbc79b8dae4ddc8147 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 7 Jan 2021 09:54:13 +0100 Subject: [PATCH] corrects calculation of speed in kmh --- static/scripts/chartfull.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/scripts/chartfull.js b/static/scripts/chartfull.js index 5804634..cc149f0 100644 --- a/static/scripts/chartfull.js +++ b/static/scripts/chartfull.js @@ -56,7 +56,7 @@ function addSerialSpeedData() { let speeds = [] indexes.forEach(index => { - speeds.push((allSpeedsSerial[index].toFixed(2) * 3.6 * 3.6)) + speeds.push((allSpeedsSerial[index] * 3.6).toFixed(2)) }) myChart.data.datasets[0].data = speeds; myChart.update(); @@ -71,7 +71,7 @@ function addTCPSpeedData(sensordataList) { return; } let speed = sensordata.Speed - speedsTCP.push(speed * 3.6); + speedsTCP.push((speed * 3.6).toFixed(2)); let time = sensordata.Servertime times.push(time)