fix: Messwertlinie (m) im DIA0-Modus in DetailModal sichtbar gemacht

This commit is contained in:
ISA
2025-07-11 08:23:15 +02:00
parent e9a6d45d1f
commit bb8b345647
13 changed files with 194 additions and 15 deletions

View File

@@ -36,10 +36,12 @@ ChartJS.register(
);
type ReduxDataEntry = {
t: string;
i: number;
a?: number;
g?: number;
//Alle DIA0 t,m,i,a , DIA1 und DIA2 t,i,a,g
t: string; // Zeitstempel
i: number; // Minimum
a: number; // Maximum
g?: number; // Durchschnitt (optional, falls vorhanden)
m?: number; // aktueller Messwert (optional, falls vorhanden)
};
const chartOptions = {
@@ -120,7 +122,7 @@ export const DetailModal = ({
datasets: [],
});
const reduxData: ReduxDataEntry[] = useSelector((state: RootState) => {
const reduxData = useSelector((state: RootState) => {
switch (selectedKey) {
case "+5V":
return state.systemspannung5Vplus[zeitraum];
@@ -137,7 +139,7 @@ export const DetailModal = ({
default:
return [];
}
});
}) as ReduxDataEntry[];
const isFullScreen = useSelector(
(state: RootState) => state.kabelueberwachungChartSlice.isFullScreen
@@ -192,8 +194,11 @@ export const DetailModal = ({
tension: 0.1,
},
{
label: "Durchschnitt",
data: sortedData.map((p) => ({ x: new Date(p.t), y: p.g })),
label: zeitraum === "DIA0" ? "Messwert" : "Durchschnitt",
data: sortedData.map((p) => ({
x: new Date(p.t),
y: zeitraum === "DIA0" ? p.m : p.g,
})),
borderColor: "rgba(59,130,246,1)",
backgroundColor: "rgba(59,130,246,0.3)",
borderWidth: 2,