|
|
@@ -326,7 +326,7 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => { |
|
|
|
const result = new Array(weeklyPlannedList[0].length).fill(0); |
|
|
|
for (const arr of weeklyPlannedList) { |
|
|
|
for (let i = 0; i < arr.length; i++) { |
|
|
|
result[i] += arr[i]; |
|
|
|
result[i] = Number((result[i] + arr[i]).toFixed(2)); |
|
|
|
if (chartMax < result[i]) { |
|
|
|
chartMax = result[i] |
|
|
|
} |
|
|
@@ -334,7 +334,11 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => { |
|
|
|
} |
|
|
|
setTeamTotalManhoursSpentPlanData(result) |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
const result = new Array(weekDates.length).fill(0); |
|
|
|
setTeamTotalManhoursSpentPlanData(result) |
|
|
|
} |
|
|
|
} |
|
|
|
setTeamTotalManhoursSpentActualData(weeklyActualList); |
|
|
|
setTotalManHoursMaxValue(chartMax) |
|
|
|
} |
|
|
@@ -369,14 +373,17 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => { |
|
|
|
const result = new Array(weeklyPlannedList[0].length).fill(0); |
|
|
|
for (const arr of weeklyPlannedList) { |
|
|
|
for (let i = 0; i < arr.length; i++) { |
|
|
|
result[i] += arr[i]; |
|
|
|
result[i] = Number((result[i] + arr[i]).toFixed(2)); |
|
|
|
if (chartMax < result[i]) { |
|
|
|
chartMax = result[i] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
setTeamTotalManhoursSpentPlanData(result) |
|
|
|
} |
|
|
|
} else { |
|
|
|
const result = new Array(weekDates.length).fill(0); |
|
|
|
setTeamTotalManhoursSpentPlanData(result) |
|
|
|
} |
|
|
|
} |
|
|
|
setTeamTotalManhoursSpentActualData(weeklyActualList); |
|
|
|
setTotalManHoursMaxValue(chartMax) |
|
|
@@ -567,7 +574,7 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => { |
|
|
|
result.push(manhoursResult[i].manhours) |
|
|
|
projectCodeList.push(manhoursResult[i].projectNo) |
|
|
|
projectList.push(manhoursResult[i].projectName) |
|
|
|
percentageList.push(manhoursResult[i].percentage) |
|
|
|
percentageList.push(manhoursResult[i].manhours) |
|
|
|
} |
|
|
|
setIndividualManhoursMaxValue(maxValue) |
|
|
|
setIndividualStaffProjectList(projectList) |
|
|
@@ -599,7 +606,7 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => { |
|
|
|
result.push(manhoursResult[i].manhours) |
|
|
|
projectCodeList.push(manhoursResult[i].projectNo) |
|
|
|
projectList.push(manhoursResult[i].projectName) |
|
|
|
percentageList.push(manhoursResult[i].percentage) |
|
|
|
percentageList.push(manhoursResult[i].manhours) |
|
|
|
} |
|
|
|
setIndividualManhoursMaxValue(maxValue) |
|
|
|
setIndividualStaffProjectList(projectList) |
|
|
@@ -756,6 +763,13 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => { |
|
|
|
]; |
|
|
|
|
|
|
|
const options: ApexOptions = { |
|
|
|
tooltip: { |
|
|
|
y: { |
|
|
|
formatter: function (val) { |
|
|
|
return val.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
chart: { |
|
|
|
height: 350, |
|
|
|
type: "line", |
|
|
@@ -783,6 +797,11 @@ const StaffUtilization: React.FC<Props> = ({ abilities, staff }) => { |
|
|
|
min: 0, |
|
|
|
max: totalManHoursMaxValue, |
|
|
|
tickAmount: 5, |
|
|
|
labels: { |
|
|
|
formatter: function (val) { |
|
|
|
return val.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
], |
|
|
|
grid: { |
|
|
|