feat: Add cursor wait during chart data loading

- Implemented cursor wait state while chart data is being loaded in `AnalogInputsChart.tsx`.
- Fixed missing dependencies in `useEffect` and defined `loading` state.
- Updated `handleFetchData` to manage
This commit is contained in:
ISA
2025-07-23 13:17:31 +02:00
parent bc554d3474
commit 2272668ace
6 changed files with 20 additions and 6 deletions

View File

@@ -28,6 +28,7 @@ import {
} from "@/redux/slices/analogInputs/analogInputsHistorySlice";
import { getColor } from "@/utils/colors";
import AnalogInputsDatePicker from "./AnalogInputsDatePicker";
import type { ChartJSOrUndefined } from "react-chartjs-2/dist/types";
// ✅ Nur die Basis-ChartJS-Module registrieren
ChartJS.register(
@@ -53,7 +54,11 @@ export default function AnalogInputsChart() {
}, []);
const dispatch = useDispatch<AppDispatch>();
const chartRef = useRef<Line>(null); // Specify Line type for chartRef
const chartRef =
useRef<
ChartJSOrUndefined<"line", { x: Date; y: number | undefined }[], unknown>
>(null);
// Redux Werte für Chart-Daten
const { zeitraum, vonDatum, bisDatum, data, autoLoad, selectedId } =