Datum und Uhrzeit auf X-Achse im KÜ Chart, aber Bug :Durchschnitt ist zweimal da in DIA1 und DIA2

This commit is contained in:
ISA
2025-02-20 15:18:24 +01:00
parent 8f6a22d0c3
commit a98f8297bc
2 changed files with 31 additions and 10 deletions

View File

@@ -124,16 +124,37 @@ const LoopMeasurementChart = () => {
x: {
type: "time",
time: {
unit: "day",
tooltipFormat: "dd.MM.yyyy HH:mm",
displayFormats: { day: "dd.MM.yyyy" },
unit: "minute", // Stelle sicher, dass jede Minute angezeigt wird
tooltipFormat: "dd.MM.yyyy HH:mm", // Tooltip zeigt Datum & Uhrzeit
displayFormats: {
minute: "dd.MM.yyyy HH:mm", // Zeigt bei jedem Tick Datum & Uhrzeit
hour: "dd.MM.yyyy HH:mm", // Falls stündliche Werte vorliegen
day: "dd.MM.yyyy", // Falls tägliche Werte angezeigt werden
},
},
title: {
display: true,
text: "Zeit (Datum & Uhrzeit)",
},
ticks: {
autoSkip: false, // Keine Ticks auslassen
maxRotation: 45, // Falls nötig, dreht die Labels für bessere Lesbarkeit
minRotation: 45,
callback: function (value, index, values) {
const date = new Date(value);
return `${date.getDate().toString().padStart(2, "0")}.${(
date.getMonth() + 1
)
.toString()
.padStart(2, "0")}.${date.getFullYear()} ${date
.getHours()
.toString()
.padStart(2, "0")}:${date
.getMinutes()
.toString()
.padStart(2, "0")}`;
},
},
title: { display: true, text: "Zeit" },
},
y: {
title: { display: true, text: "kOhm" },
min: 0,
max: 80,
},
},
},