TDR X-Achse Entfernung und kein Zeit

This commit is contained in:
ISA
2025-01-28 14:55:24 +01:00
parent 4ea78f26da
commit df68d17f6f

View File

@@ -212,6 +212,12 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
chartInstance.current = null; // Referenz zurücksetzen chartInstance.current = null; // Referenz zurücksetzen
} }
// Maximal- und Minimalwerte berechnen
const minX = Math.min(...dataTDR.map((row) => row.t));
const maxX = Math.max(...dataTDR.map((row) => row.t));
const minY = Math.min(...dataTDR.map((row) => row.m));
const maxY = Math.max(...dataTDR.map((row) => row.m));
// Neues Chart erstellen // Neues Chart erstellen
try { try {
chartInstance.current = new Chart(ctx, { chartInstance.current = new Chart(ctx, {
@@ -223,13 +229,20 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
label: "Pegel", label: "Pegel",
data: dataTDR.map((row) => row.m), data: dataTDR.map((row) => row.m),
borderColor: "#00AEEF", borderColor: "#00AEEF",
borderWidth: 1, borderWidth: 2,
fill: false, fill: false,
tension: 0.1, // Weiche Kurve
}, },
], ],
}, },
options: { options: {
responsive: true, responsive: true,
maintainAspectRatio: false, // Ermöglicht flexible Größe
layout: {
padding: {
bottom: 25, // Fügt zusätzliches Padding unten hinzu
},
},
plugins: { plugins: {
zoom: { zoom: {
pan: { pan: {
@@ -251,10 +264,14 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
x: { x: {
type: "linear", type: "linear",
position: "bottom", position: "bottom",
title: { display: true, text: "Zeit" }, title: { display: true, text: "Entfernung" },
min: minX - 5, // Etwas Puffer hinzufügen
max: maxX + 5,
}, },
y: { y: {
title: { display: true, text: "Pegel" }, title: { display: true, text: "Pegel" },
min: minY - 10, // Puffer für Y-Werte
max: maxY + 10,
}, },
}, },
}, },