createTDRChart in Kue705FO.jsx
This commit is contained in:
@@ -152,6 +152,36 @@ function Kue705FO({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCloseChartModal = () => setShowChartModal(false);
|
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 loadTDRChartData = () => {
|
||||||
const slot = slotIndex;
|
const slot = slotIndex;
|
||||||
|
|||||||
Reference in New Issue
Block a user