feat(members-time-sheet): enhance utilization display with color indicators
This commit is contained in:
@@ -104,29 +104,20 @@ const MembersTimeSheet = forwardRef<MembersTimeSheetRef>((_, ref) => {
|
|||||||
let color = '';
|
let color = '';
|
||||||
if (percent < 90) {
|
if (percent < 90) {
|
||||||
status = 'Under';
|
status = 'Under';
|
||||||
|
color = '🟧';
|
||||||
} else if (percent <= 110) {
|
} else if (percent <= 110) {
|
||||||
status = 'Optimal';
|
status = 'Optimal';
|
||||||
|
color = '🟩';
|
||||||
} else {
|
} else {
|
||||||
status = 'Over';
|
status = 'Over';
|
||||||
|
color = '🟥';
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
`${context.dataset.label}: ${hours} h`,
|
`${context.dataset.label}: ${hours} h`,
|
||||||
`Utilization: ${percent}%`,
|
`${color} Utilization: ${percent}%`,
|
||||||
`${status} Utilized: ${overUnder} h`
|
`${status} Utilized: ${overUnder} h`
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
labelTextColor: function (context: any) {
|
|
||||||
const idx = context.dataIndex;
|
|
||||||
const member = jsonData[idx];
|
|
||||||
const utilization = parseFloat(member?.utilization_percent || '0');
|
|
||||||
if (utilization < 90) {
|
|
||||||
return '#FFB546';
|
|
||||||
} else if (utilization >= 90 && utilization <= 110) {
|
|
||||||
return '#B2EF9A';
|
|
||||||
} else {
|
|
||||||
return '#FE7173';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user