From 350aa9e4a3590d677b4300caadafb8dc5536c4fc Mon Sep 17 00:00:00 2001 From: Pablo Revilla Date: Tue, 9 Dec 2025 17:40:49 -0800 Subject: [PATCH] Fix chart on node.html. --- meshview/templates/node.html | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/meshview/templates/node.html b/meshview/templates/node.html index 9799cab..155b6fd 100644 --- a/meshview/templates/node.html +++ b/meshview/templates/node.html @@ -989,9 +989,19 @@ async function loadNeighborTimeSeries() { }); } - // Build merged x-axis from first neighbor’s timestamps - // (Your original code already behaved this way) - const sampleTimes = Object.values(neighborHistory)[0]?.times || []; + // Collect all timestamps from all neighbors + const allTimesSet = new Set(); + + for (const entry of Object.values(neighborHistory)) { + for (const t of entry.times) { + allTimesSet.add(t); + } + } + + // Convert to array and sort chronologically + const sampleTimes = Array.from(allTimesSet).sort((a, b) => { + return new Date(a) - new Date(b); + }); chart.setOption({ tooltip: { trigger: "axis" },