From 81a16c28ac115b67192a1c069c86ade9aa4b3508 Mon Sep 17 00:00:00 2001 From: Wahyu Ramadhan Date: Thu, 16 Feb 2023 13:26:16 +0700 Subject: [PATCH] Fix ui dashboard bod --- src/views/Dashboard/DashboardBOD.js | 35 ++++++++++++++++++----------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/src/views/Dashboard/DashboardBOD.js b/src/views/Dashboard/DashboardBOD.js index f22d136..8515a48 100644 --- a/src/views/Dashboard/DashboardBOD.js +++ b/src/views/Dashboard/DashboardBOD.js @@ -406,6 +406,15 @@ const DashboardBOD = () => { { datalabels: { color: '#FFFFFF', formatter: function(value, context) { - return value ? toRupiah(value, {useUnit: 'jt'}) : 0 + return value ? toRupiah(value, { useUnit: 'jt' }) : 0 } } }, @@ -489,10 +498,10 @@ const DashboardBOD = () => { label: "", // data: [2, 4, 10], data: [ - PROJECT_BY_FINANCIAL_HEALTH && PROJECT_BY_FINANCIAL_HEALTH.overrun ? PROJECT_BY_FINANCIAL_HEALTH.overrun : 0, - PROJECT_BY_FINANCIAL_HEALTH && PROJECT_BY_FINANCIAL_HEALTH.warning ? PROJECT_BY_FINANCIAL_HEALTH.warning : 0, - PROJECT_BY_FINANCIAL_HEALTH && PROJECT_BY_FINANCIAL_HEALTH['on-budget'] ? PROJECT_BY_FINANCIAL_HEALTH['on-budget'] : 0 - ], + PROJECT_BY_FINANCIAL_HEALTH && PROJECT_BY_FINANCIAL_HEALTH.overrun ? PROJECT_BY_FINANCIAL_HEALTH.overrun : '', + PROJECT_BY_FINANCIAL_HEALTH && PROJECT_BY_FINANCIAL_HEALTH.warning ? PROJECT_BY_FINANCIAL_HEALTH.warning : '', + PROJECT_BY_FINANCIAL_HEALTH && PROJECT_BY_FINANCIAL_HEALTH['on-budget'] ? PROJECT_BY_FINANCIAL_HEALTH['on-budget'] : '' + ].filter(value => value !== null), borderColor: ["#E80053", "#FFD600", "#52AC0B",], backgroundColor: ["#E80053", "#FFD600", "#52AC0B",], borderWidth: 2, @@ -515,9 +524,9 @@ const DashboardBOD = () => { label: "", // data: [1, 3, 11], data: [ - PROJECT_BY_SCHEDULE_HEALTH && PROJECT_BY_SCHEDULE_HEALTH['behind-schedule'] ? PROJECT_BY_SCHEDULE_HEALTH['behind-schedule'] : 0, - PROJECT_BY_SCHEDULE_HEALTH && PROJECT_BY_SCHEDULE_HEALTH.warning ? PROJECT_BY_SCHEDULE_HEALTH.warning : 0, - PROJECT_BY_SCHEDULE_HEALTH && PROJECT_BY_SCHEDULE_HEALTH['on-schedule'] ? PROJECT_BY_SCHEDULE_HEALTH['on-schedule'] : 0 + PROJECT_BY_SCHEDULE_HEALTH && PROJECT_BY_SCHEDULE_HEALTH['behind-schedule'] ? PROJECT_BY_SCHEDULE_HEALTH['behind-schedule'] : '', + PROJECT_BY_SCHEDULE_HEALTH && PROJECT_BY_SCHEDULE_HEALTH.warning ? PROJECT_BY_SCHEDULE_HEALTH.warning : '', + PROJECT_BY_SCHEDULE_HEALTH && PROJECT_BY_SCHEDULE_HEALTH['on-schedule'] ? PROJECT_BY_SCHEDULE_HEALTH['on-schedule'] : '' ], borderColor: ["#E80053", "#FFD600", "#52AC0B"], backgroundColor: ["#E80053", "#FFD600", "#52AC0B"], @@ -571,8 +580,8 @@ const DashboardBOD = () => { label: "", // data: [7, 2, 4, 3], data: PROJECT_PER_DIVISION ? PROJECT_PER_DIVISION.map((item, idx) => item.total) : [], - borderColor: ["#023E8A", "#C851B7", "#FD7034", "#3A0CA3"], - backgroundColor: ["#023E8A", "#C851B7", "#FD7034", "#3A0CA3"], + borderColor: ["#023E8A", "#C851B7", "#FD7034", "#3A0CA3", "#A36A16"], + backgroundColor: ["#023E8A", "#C851B7", "#FD7034", "#3A0CA3", "#A36A16"], borderWidth: 2, borderSkipped: false }, @@ -622,9 +631,9 @@ const DashboardBOD = () => { { label: "", // data: [50, 120, 72, 60], - data: PROJECT_VALUE_PER_DIVISION ? PROJECT_VALUE_PER_DIVISION.map((item, idx) => item.total) : [], - borderColor: ["#023E8A", "#C851B7", "#FD7034", "#3A0CA3"], - backgroundColor: ["#023E8A", "#C851B7", "#FD7034", "#3A0CA3"], + data: PROJECT_VALUE_PER_DIVISION ? PROJECT_VALUE_PER_DIVISION.map((item, idx) => item.total).filter(value => value !== 0) : [], + borderColor: ["#023E8A", "#C851B7", "#FD7034", "#3A0CA3", "#A36A16"], + backgroundColor: ["#023E8A", "#C851B7", "#FD7034", "#3A0CA3", "#A36A16"], borderWidth: 2, borderSkipped: false },