From db90f03a025287677a3f2b48977f432b2227df5d Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Thu, 20 Jun 2024 14:34:55 +0100 Subject: [PATCH] Discard runs that didn't start on the hour I started a run between hours a few weeks back to let a database migration finish without interrupting an actual run. This made the graph illegible by decreasing the smallest duration between two individual runs, making chartjs unable to automatically determine the best width for each column (it made them way too thin). Resolved by discarding any runs that start more than 3 minutes after the start of each hour. --- stats-frontend/graphs.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stats-frontend/graphs.html b/stats-frontend/graphs.html index ccc19fa..589d5fd 100644 --- a/stats-frontend/graphs.html +++ b/stats-frontend/graphs.html @@ -65,6 +65,11 @@ } }) + // Discard any activations that didn't start on the hour + recentNotifications.activations = recentNotifications.activations.filter( + activation => activation["start_timestamp"] % 3600 < 180 + ) + // Bind channels data to activations data for ( let activationIndex = 0;