diff --git a/src/app/(protected)/dashboard/student/dashboard/page.tsx b/src/app/(protected)/dashboard/student/dashboard/page.tsx index 2db7818..4c90a1a 100644 --- a/src/app/(protected)/dashboard/student/dashboard/page.tsx +++ b/src/app/(protected)/dashboard/student/dashboard/page.tsx @@ -94,6 +94,12 @@ export default function StudentDashboard() { errorPieChartData, } = data; const COLORS = ["#4CAF50", "#FFC107"]; + const EMPTY_CHART_COLOR = "#E5E7EB"; + const hasCompletionRecord = completionData.completed > 0; + const hasErrorChartData = errorPieChartData.some((item) => item.value > 0); + const normalizedErrorPieChartData = hasErrorChartData + ? errorPieChartData + : [{ name: "暂无数据", value: 1 }]; return (