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:
@@ -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 } =
|
||||
|
||||
Reference in New Issue
Block a user