From f7bc6c14f36e3217e34c24983de3f2ea9daee3f3 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 30 Dec 2023 12:59:47 +0200 Subject: [PATCH] Fix chart styles + date not matching Closes #1518 --- app/components/Chart.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/components/Chart.tsx b/app/components/Chart.tsx index 023da605a..1450ea5a0 100644 --- a/app/components/Chart.tsx +++ b/app/components/Chart.tsx @@ -19,6 +19,7 @@ export default function Chart({ headerSuffix?: string; valueSuffix?: string; }) { + const { i18n } = useTranslation(); const theme = useTheme(); const isMounted = useIsMounted(); @@ -27,8 +28,18 @@ export default function Chart({ >( () => ({ getValue: (datum) => datum.primary, + scaleType: "localTime", + shouldNice: false, + formatters: { + scale: (val) => { + return val.toLocaleDateString(i18n.language, { + day: "numeric", + month: "numeric", + }); + }, + }, }), - [], + [i18n.language], ); const secondaryAxes = React.useMemo< @@ -60,6 +71,8 @@ export default function Chart({ /> ), }, + primaryCursor: false, + secondaryCursor: false, primaryAxis, secondaryAxes, dark: theme.htmlThemeClass === Theme.DARK,