From d8567ee5c6e6661bd637bdee273e997617bc7f40 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Sun, 28 Apr 2024 22:30:45 -0700 Subject: [PATCH 1/3] Fix tooltip showing as undefined for first tick --- web/src/components/graph/SystemGraph.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/web/src/components/graph/SystemGraph.tsx b/web/src/components/graph/SystemGraph.tsx index 81db46e7bc..a286abb80e 100644 --- a/web/src/components/graph/SystemGraph.tsx +++ b/web/src/components/graph/SystemGraph.tsx @@ -37,10 +37,6 @@ export function ThresholdBarGraph({ const formatTime = useCallback( (val: unknown) => { - if (val == 1) { - return; - } - const date = new Date(updateTimes[Math.round(val as number) - 1] * 1000); return date.toLocaleTimeString([], { hour12: config?.ui.time_format != "24hour", @@ -111,8 +107,8 @@ export function ThresholdBarGraph({ tickPlacement: "on", labels: { rotate: 0, - offsetX: -18, formatter: formatTime, + offsetX: isMobileOnly ? -18 : 0, }, axisBorder: { show: false, @@ -302,10 +298,6 @@ export function CameraLineGraph({ const formatTime = useCallback( (val: unknown) => { - if (val == 1) { - return; - } - const date = new Date(updateTimes[Math.round(val as number)] * 1000); return date.toLocaleTimeString([], { hour12: config?.ui.time_format != "24hour", From c32da6abbcc79b5ceb3bec5f42b219b4c77a610e Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Sun, 28 Apr 2024 22:33:01 -0700 Subject: [PATCH 2/3] Rearrange to simplify diff --- web/src/components/graph/SystemGraph.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/graph/SystemGraph.tsx b/web/src/components/graph/SystemGraph.tsx index a286abb80e..38c7cb2400 100644 --- a/web/src/components/graph/SystemGraph.tsx +++ b/web/src/components/graph/SystemGraph.tsx @@ -107,8 +107,8 @@ export function ThresholdBarGraph({ tickPlacement: "on", labels: { rotate: 0, - formatter: formatTime, offsetX: isMobileOnly ? -18 : 0, + formatter: formatTime, }, axisBorder: { show: false, From 390093dde94b061f0becbc693da31b5000363b83 Mon Sep 17 00:00:00 2001 From: Sean Kelly Date: Mon, 29 Apr 2024 07:42:26 -0700 Subject: [PATCH 3/3] Remove offset for mobile --- web/src/components/graph/SystemGraph.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/src/components/graph/SystemGraph.tsx b/web/src/components/graph/SystemGraph.tsx index 38c7cb2400..834f6e6b4e 100644 --- a/web/src/components/graph/SystemGraph.tsx +++ b/web/src/components/graph/SystemGraph.tsx @@ -107,7 +107,6 @@ export function ThresholdBarGraph({ tickPlacement: "on", labels: { rotate: 0, - offsetX: isMobileOnly ? -18 : 0, formatter: formatTime, }, axisBorder: { @@ -346,7 +345,6 @@ export function CameraLineGraph({ tickPlacement: "on", labels: { rotate: 0, - offsetX: isMobileOnly ? -18 : 0, formatter: formatTime, }, axisBorder: {