From 48b8df8f4edc1bb13fe1bf609807db0bb38ae2d1 Mon Sep 17 00:00:00 2001 From: andreas-unleash Date: Tue, 9 Apr 2024 16:20:32 +0300 Subject: [PATCH] fix: Health tooltip when all projects should show % (#6809) What it says on the tin Closes # [1-2274](https://linear.app/unleash/issue/1-2274/health-tooltip-when-all-projects-should-show-percent-values) Screenshot 2024-04-09 at 16 09 34 Signed-off-by: andreas-unleash --- .../ProjectHealthChart/ProjectHealthChart.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/component/insights/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx b/frontend/src/component/insights/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx index 4253c9a9bf..130470abe8 100644 --- a/frontend/src/component/insights/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx +++ b/frontend/src/component/insights/componentsChart/ProjectHealthChart/ProjectHealthChart.tsx @@ -62,16 +62,19 @@ export const ProjectHealthChart: VFC = ({ ); }) .sort((a, b) => (a.week > b.week ? 1 : -1)); - return { datasets: [ { label: 'Health', data: weeks.map((item) => ({ health: item.total - ? ((item.total - item.stale) / item.total) * 100 + ? ( + ((item.total - item.stale) / item.total) * + 100 + ).toFixed(2) : undefined, date: item.date, + total: item.total, })), borderColor: theme.palette.primary.light, backgroundColor: fillGradientPrimary, @@ -93,7 +96,7 @@ export const ProjectHealthChart: VFC = ({