From 49e7d6c6c4bbd7ab5aec835136802f4002da11ea Mon Sep 17 00:00:00 2001 From: ISA Date: Wed, 19 Mar 2025 07:20:46 +0100 Subject: [PATCH] WIP:DatePicker in Messkurven --- .../LoopMeasurementChart.tsx | 16 +++++++++++++++- config/webVersion.ts | 2 +- redux/slices/variablesSlice.ts | 8 +++++++- utils/colors.ts | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopMeasurementChart.tsx b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopMeasurementChart.tsx index e7d8f3f..8b1ea42 100644 --- a/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopMeasurementChart.tsx +++ b/components/main/kabelueberwachung/kue705FO/Charts/LoopMeasurementChart/LoopMeasurementChart.tsx @@ -206,7 +206,21 @@ const LoopMeasurementChart = () => { const date = new Date(zeit); return `${date.getDate()}.${date.getMonth() + 1}`; }} - tick={{ angle: -25, dy: 5 }} // Dreht die Labels für bessere Übersicht + tick={(props) => { + const { x, y, payload } = props; + const date = new Date(payload.value); + return ( + + {`${date.getDate()}.${date.getMonth() + 1}`} + + ); + }} // Dreht die Labels für bessere Übersicht /> ) { + state.selectedChartData = action.payload; + }, setVariable( state, action: PayloadAction<{ @@ -99,6 +104,7 @@ const variablesSlice = createSlice({ }, }); -export const { setVariable, setVariables } = variablesSlice.actions; +export const { setSelectedChartData, setVariable, setVariables } = + variablesSlice.actions; export default variablesSlice.reducer; diff --git a/utils/colors.ts b/utils/colors.ts index dba7970..0dd6e9c 100644 --- a/utils/colors.ts +++ b/utils/colors.ts @@ -1,4 +1,4 @@ -const tailwindColors = { +const tailwindColors: Record = { "littwin-blue": "#00AEEF", // Hier alle Tailwind-Farben manuell eintragen };