createTDRChart in Kue705FO.jsx

This commit is contained in:
ISA
2024-11-06 07:23:39 +01:00
parent 7eca4204bd
commit df22aa2b5d

View File

@@ -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;