From de0bebd7ad15366b5b6b1f1252a699611dc49595 Mon Sep 17 00:00:00 2001 From: Fredrik Strand Oseberg Date: Thu, 1 Feb 2024 10:31:11 +0100 Subject: [PATCH] fix: set correct lables for project charts (#6099) --- .../FlagsProjectChart/FlagsProjectChart.tsx | 4 +++- .../ProjectHealthChart/ProjectHealthChart.tsx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/executiveDashboard/FlagsProjectChart/FlagsProjectChart.tsx b/frontend/src/component/executiveDashboard/FlagsProjectChart/FlagsProjectChart.tsx index 5f4255b5fd..176ea1086f 100644 --- a/frontend/src/component/executiveDashboard/FlagsProjectChart/FlagsProjectChart.tsx +++ b/frontend/src/component/executiveDashboard/FlagsProjectChart/FlagsProjectChart.tsx @@ -40,8 +40,10 @@ export const FlagsProjectChart: VFC = ({ }, ); + const objectKeys = Object.keys(groupedFlagTrends); + return { - labels: projectFlagTrends.map((item) => item.date), + labels: groupedFlagTrends[objectKeys[0]].map((item) => item.date), datasets, }; }, [theme, projectFlagTrends]); diff --git a/frontend/src/component/executiveDashboard/ProjectHealthChart/ProjectHealthChart.tsx b/frontend/src/component/executiveDashboard/ProjectHealthChart/ProjectHealthChart.tsx index bdf6449962..da5b0e0e6b 100644 --- a/frontend/src/component/executiveDashboard/ProjectHealthChart/ProjectHealthChart.tsx +++ b/frontend/src/component/executiveDashboard/ProjectHealthChart/ProjectHealthChart.tsx @@ -41,8 +41,10 @@ export const ProjectHealthChart: VFC = ({ }, ); + const objectKeys = Object.keys(groupedFlagTrends); + return { - labels: projectFlagTrends.map((item) => item.date), + labels: groupedFlagTrends[objectKeys[0]].map((item) => item.date), datasets, }; }, [theme, projectFlagTrends]);