Schleifenmessung von Mock->Redux

This commit is contained in:
ISA
2025-02-14 11:43:17 +01:00
parent d4d58695b5
commit 0d1355457b
3 changed files with 17 additions and 26 deletions

View File

@@ -1,26 +1,14 @@
import React, { useEffect, useRef } from "react";
import { useSelector } from "react-redux";
import { RootState } from "../../../../../../redux/store";
import Chart from "chart.js/auto";
import "chartjs-adapter-moment";
const LoopMeasurementChart: React.FC = () => {
const chartRef = useRef<HTMLCanvasElement>(null);
const chartInstance = useRef<Chart | null>(null);
const LoopMeasurementChart = () => {
const chartRef = useRef(null);
const chartInstance = useRef(null);
// Mock-Daten für das Beispiel
const chartData = [
{ t: "14-02-2025 10:00:00", i: 3.116, a: 3.116, g: 3.116 },
{ t: "14-02-2025 09:00:00", i: 8.116, a: 3.116, g: 15.116 },
{ t: "14-02-2025 08:00:00", i: 3.116, a: 3.116, g: 3.116 },
{ t: "13-02-2025 15:00:00", i: 9.116, a: 21.0, g: 65.0 },
{ t: "13-02-2025 14:00:00", i: 65.0, a: 65.0, g: 65.0 },
{ t: "13-02-2025 13:00:00", i: 65.0, a: 65.0, g: 65.0 },
{ t: "13-02-2025 12:00:00", i: 65.0, a: 65.0, g: 65.0 },
{ t: "13-02-2025 11:00:00", i: 65.0, a: 65.0, g: 65.0 },
{ t: "13-02-2025 10:00:00", i: 65.0, a: 65.0, g: 65.0 },
{ t: "13-02-2025 09:00:00", i: 50.0, a: 30.0, g: 25.0 },
];
// Daten aus dem Redux-Store abrufen
const chartData = useSelector((state) => state.chartData.data) ?? [];
useEffect(() => {
if (chartRef.current) {
@@ -112,7 +100,7 @@ const LoopMeasurementChart: React.FC = () => {
chartInstance.current = null;
}
};
}, []);
}, [chartData]);
return (
<div style={{ position: "relative", width: "100%", height: "400px" }}>

View File

@@ -6,5 +6,5 @@
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
*/
const webVersion = "1.6.46";
const webVersion = "1.6.47";
export default webVersion;

View File

@@ -1,9 +1,12 @@
[
{ "t": "13-02-2025 15:00:00", "i": 60.0, "a": 65.0, "g": 70.0 },
{ "t": "14-02-2025 14:00:00", "i": 65.0, "a": 65.0, "g": 65.0 },
{ "t": "14-02-2025 13:00:00", "i": 65.0, "a": 65.0, "g": 65.0 },
{ "t": "15-02-2025 12:00:00", "i": 65.0, "a": 65.0, "g": 65.0 },
{ "t": "15-02-2025 11:00:00", "i": 65.0, "a": 65.0, "g": 65.0 },
{ "t": "16-02-2025 10:00:00", "i": 65.0, "a": 65.0, "g": 65.0 },
{ "t": "17-02-2025 09:00:00", "i": 65.0, "a": 65.0, "g": 65.0 }
{ "t": "14-02-2025 10:00:00", "i": 10.116, "a": 3.116, "g": 3.116 },
{ "t": "14-02-2025 09:00:00", "i": 3.116, "a": 8.116, "g": 3.116 },
{ "t": "14-02-2025 08:00:00", "i": 3.116, "a": 3.116, "g": 25.116 },
{ "t": "13-02-2025 15:00:00", "i": 5.0, "a": 65.0, "g": 65.0 },
{ "t": "13-02-2025 14:00:00", "i": 65.0, "a": 6.0, "g": 65.0 },
{ "t": "13-02-2025 13:00:00", "i": 65.0, "a": 65.0, "g": 70.0 },
{ "t": "13-02-2025 12:00:00", "i": 65.0, "a": 65.0, "g": 65.0 },
{ "t": "13-02-2025 11:00:00", "i": 65.0, "a": 65.0, "g": 65.0 },
{ "t": "13-02-2025 10:00:00", "i": 65.0, "a": 65.0, "g": 65.0 },
{ "t": "13-02-2025 09:00:00", "i": 65.0, "a": 65.0, "g": 65.0 }
]