diff --git a/components/modules/Kue705FO.jsx b/components/modules/Kue705FO.jsx index 2b7be0c..4d15bd6 100644 --- a/components/modules/Kue705FO.jsx +++ b/components/modules/Kue705FO.jsx @@ -152,6 +152,36 @@ function Kue705FO({ }; const handleCloseChartModal = () => setShowChartModal(false); + // Funktion zum Erstellen des TDR-Charts + const createTDRChart = (dataTDR) => { + const ctx = document.getElementById("myChart").getContext("2d"); + + new Chart(ctx, { + type: "line", + data: { + labels: dataTDR.map((row) => row.t), // Entfernung oder Zeit auf der x-Achse + datasets: [ + { + label: "Pegel", + data: dataTDR.map((row) => row.m), // Nur Pegel auf der y-Achse + borderColor: "#00AEEF", + borderWidth: 1, + pointBorderWidth: 0, + pointStyle: false, + fill: false, + }, + ], + }, + options: { + scales: { + y: { + type: "linear", + position: "left", + }, + }, + }, + }); + }; const loadTDRChartData = () => { const slot = slotIndex;