From 42d5eeb7e5c77887875407086623b93b90076d54 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 10 Oct 2024 08:52:25 +0200 Subject: [PATCH] fix: display tick values for chart Y axis (#8412) This PR adds back in ticks for the Y axis of the chart. The ticks were removed when updating the no content chart and this was an oversight. --- .../component/personalDashboard/createChartOptions.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/personalDashboard/createChartOptions.ts b/frontend/src/component/personalDashboard/createChartOptions.ts index 19168f0392..f19b75eca8 100644 --- a/frontend/src/component/personalDashboard/createChartOptions.ts +++ b/frontend/src/component/personalDashboard/createChartOptions.ts @@ -7,6 +7,7 @@ import { formatDateYMD, formatDateYMDHM, } from '../../utils/formatDate'; +import { formatTickValue } from 'component/common/Chart/formatTickValue'; const formatVariantEntry = ( variant: [string, number], @@ -168,7 +169,15 @@ export const createBarChartOptions = ( }, }, }, - y: scales ? scales.y : {}, + y: { + ...(scales?.y ?? {}), + ticks: { + ...(scales?.y?.ticks ?? {}), + color: theme.palette.text.secondary, + callback: formatTickValue, + display: true, + }, + }, }, elements, interaction,