diff --git a/components/modules/Kue705FO.jsx b/components/modules/Kue705FO.jsx index b549791..63bc96f 100644 --- a/components/modules/Kue705FO.jsx +++ b/components/modules/Kue705FO.jsx @@ -64,21 +64,34 @@ function Kue705FO({ const createChart = (data) => { const ctx = document.getElementById("myChart").getContext("2d"); + // Funktion zur Umwandlung des Datums in das deutsche Format + const formatToGermanDate = (timestamp) => { + const date = new Date(timestamp); + return new Intl.DateTimeFormat("de-DE", { + day: "2-digit", + month: "2-digit", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }).format(date); + }; + new Chart(ctx, { type: "line", data: { - labels: data.map((row) => row.t), // Zeitwerte + labels: data.map((row) => formatToGermanDate(row.t)).reverse(), // Zeitwerte ins deutsche Format umwandeln und umkehren datasets: [ { label: "Isolationswiderstand", - data: data.map((row) => row.m), + data: data.map((row) => row.m).reverse(), borderColor: "#00AEEF", fill: false, yAxisID: "y", }, { label: "Schleifenwiderstand", - data: data.map((row) => row.n), + data: data.map((row) => row.n).reverse(), borderColor: "black", fill: false, yAxisID: "y1",