Fix chart on node.html.

This commit is contained in:
Pablo Revilla
2025-12-09 17:40:49 -08:00
parent e5bbf972c7
commit 350aa9e4a3
+13 -3
View File
@@ -989,9 +989,19 @@ async function loadNeighborTimeSeries() {
});
}
// Build merged x-axis from first neighbors 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" },