diff --git a/client/src/components/dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx b/client/src/components/dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx index a177771c3..c4aa9ec6b 100644 --- a/client/src/components/dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx +++ b/client/src/components/dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx @@ -54,7 +54,9 @@ export default function DashboardMonthlyEmployeeEfficiency({ const theValue = { date: moment(val).format("DD"), - ...dailyHrs, + // ...dailyHrs, + actual: dailyHrs.actual.toFixed(1), + productive: dailyHrs.productive.toFixed(1), dailyEfficiency: isNaN(dailyEfficiency) ? 0 : dailyEfficiency.toFixed(1), accActual: acc.length > 0 @@ -67,12 +69,18 @@ export default function DashboardMonthlyEmployeeEfficiency({ : dailyHrs.productive, accEfficiency: 0, }; - theValue.accEfficiency = ( + + theValue.accEfficiency = ((theValue.accProductive - theValue.accActual) / - (theValue.accActual || 1) + + (theValue.accActual || 0) + 1) * - 100 - ).toFixed(1); + 100; + + if (isNaN(theValue.accEfficiency)) { + theValue.accEfficiency = 0; + } else { + theValue.accEfficiency = theValue.accEfficiency.toFixed(1); + } return [...acc, theValue]; }, []); @@ -131,6 +139,7 @@ export default function DashboardMonthlyEmployeeEfficiency({ //stackId="day" barSize={20} fill="#102568" + format={"0.0"} />