From f4cf5d259d16810b758a93fd37a2601be1773732 Mon Sep 17 00:00:00 2001 From: Antti Aarnio Date: Thu, 2 May 2024 20:57:03 +0300 Subject: [PATCH] changed default chart bar label to new formt of 'X.Y h' --- frontend/src/components/TimeLogsPage/TimeLogChart.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/TimeLogsPage/TimeLogChart.jsx b/frontend/src/components/TimeLogsPage/TimeLogChart.jsx index 7560097b..281e1232 100644 --- a/frontend/src/components/TimeLogsPage/TimeLogChart.jsx +++ b/frontend/src/components/TimeLogsPage/TimeLogChart.jsx @@ -75,7 +75,8 @@ const TimeLogChart = (props) => { altLabel: `${hours} h, ${minutesLeft} min`, hLabel: `${hours} hours`, minutes: minutesLeft, - mLabel: `${minutesLeft} minutes` + mLabel: `${minutesLeft} minutes`, + defaultLabel: `${altHours.toFixed(1)} h` }) } } else { @@ -93,7 +94,8 @@ const TimeLogChart = (props) => { altLabel: `${hours} h, ${minutesLeft} min`, hLabel: `${hours} hours`, minutes: minutesLeft, - mLabel: `${minutesLeft} minutes` + mLabel: `${minutesLeft} minutes`, + defaultLabel: `${altHours.toFixed(1)} h` }) } } @@ -124,7 +126,7 @@ const TimeLogChart = (props) => { dataKey='altHours' background={false} > - + {chartData.map((entry, index) => ( ))} @@ -178,7 +180,7 @@ const TimeLogChart = (props) => { dataKey='altHours' background={false} > - + {chartData.map((entry, index) => ( ))}