@ -52,6 +52,10 @@ const DashboardBOD = (props) => {
const [ READY _PROJECT _SCHEDULE _BUDGET _HEALTH _PER _DIVISION , SET _READY _PROJECT _SCHEDULE _BUDGET _HEALTH _PER _DIVISION ] = useState ( false ) ;
const [ READY _PROJECT _SCHEDULE _BUDGET _HEALTH _PER _DIVISION , SET _READY _PROJECT _SCHEDULE _BUDGET _HEALTH _PER _DIVISION ] = useState ( false ) ;
const [ PROJECT _EXPENDITURE , SET _PROJECT _EXPENDITURE ] = useState ( null ) ;
const [ PROJECT _EXPENDITURE , SET _PROJECT _EXPENDITURE ] = useState ( null ) ;
const [ PROJECT _EXPENDITURE _COLOR , SET _PROJECT _EXPENDITURE _COLOR ] = useState ( null ) ;
const [ PROJECT _FINANCIAL _HEALTH _COLOR , SET _PROJECT _FINANCIAL _HEALTH _COLOR ] = useState ( null ) ;
const [ PROJECT _SCHEDULE _HEALTH _COLOR , SET _PROJECT _SCHEDULE _HEALTH _COLOR ] = useState ( null ) ;
const [ PROJECT _INVOICE _COLOR , SET _PROJECT _INVOICE _COLOR ] = useState ( null ) ;
const [ PROJECT _BY _PHASE , SET _PROJECT _BY _PHASE ] = useState ( null ) ;
const [ PROJECT _BY _PHASE , SET _PROJECT _BY _PHASE ] = useState ( null ) ;
const [ PROJECT _BY _FINANCIAL _HEALTH , SET _PROJECT _BY _FINANCIAL _HEALTH ] = useState ( null ) ;
const [ PROJECT _BY _FINANCIAL _HEALTH , SET _PROJECT _BY _FINANCIAL _HEALTH ] = useState ( null ) ;
const [ PROJECT _BY _SCHEDULE _HEALTH , SET _PROJECT _BY _SCHEDULE _HEALTH ] = useState ( null ) ;
const [ PROJECT _BY _SCHEDULE _HEALTH , SET _PROJECT _BY _SCHEDULE _HEALTH ] = useState ( null ) ;
@ -66,6 +70,10 @@ const DashboardBOD = (props) => {
useEffect ( ( ) => {
useEffect ( ( ) => {
getCompanyCashFlow ( ) ; // expenditure
getCompanyCashFlow ( ) ; // expenditure
getCompanyExpenditureColor ( ) ; // expenditure Color
getCompanyFinancialHealthColor ( ) ; // financial health Color
getCompanyScheduleHealthColor ( ) ; // schedule health Color
getCompanyInvoiceColor ( ) ; // Project Invoice vs Cash In Color
getProjectPerPhase ( ) ; // project by phase
getProjectPerPhase ( ) ; // project by phase
getInvoiceOutstanding ( ) ; // project invoice vs cash in
getInvoiceOutstanding ( ) ; // project invoice vs cash in
getProjectPerBudgetHealth ( ) ; // project by financial health
getProjectPerBudgetHealth ( ) ; // project by financial health
@ -103,6 +111,32 @@ const DashboardBOD = (props) => {
SET _READY _PROJECT _EXPENDITURE ( true ) ;
SET _READY _PROJECT _EXPENDITURE ( true ) ;
}
}
// Project Expenditure Color
const getCompanyExpenditureColor = async ( ) => {
const URL = ` ${ BASE _OSPRO } /api/dashboard/get-detail-expenditure-color/ ${ company _id } `
const result = await axios . get ( URL , HEADER ) . then ( res => res ) . catch ( err => err . response )
SET _PROJECT _EXPENDITURE _COLOR ( result . data . data )
}
const getCompanyFinancialHealthColor = async ( ) => {
const URL = ` ${ BASE _OSPRO } /api/dashboard/get-detail-financial-health-color/ ${ company _id } `
const result = await axios . get ( URL , HEADER ) . then ( res => res ) . catch ( err => err . response )
SET _PROJECT _FINANCIAL _HEALTH _COLOR ( result . data . data )
}
const getCompanyScheduleHealthColor = async ( ) => {
const URL = ` ${ BASE _OSPRO } /api/dashboard/get-detail-schedule-health-color/ ${ company _id } `
const result = await axios . get ( URL , HEADER ) . then ( res => res ) . catch ( err => err . response )
SET _PROJECT _SCHEDULE _HEALTH _COLOR ( result . data . data )
}
const getCompanyInvoiceColor = async ( ) => {
const URL = ` ${ BASE _OSPRO } /api/dashboard/get-detail-invoice-color/ ${ company _id } `
const result = await axios . get ( URL , HEADER ) . then ( res => res ) . catch ( err => err . response )
SET _PROJECT _INVOICE _COLOR ( result . data . data )
}
const getInvoiceOutstanding = async ( ) => {
const getInvoiceOutstanding = async ( ) => {
const URL = ` ${ BASE _OSPRO } /api/dashboard/get-invoice-outstanding/ ${ moment ( ) . format ( 'YYYY' ) } / ${ company _id } / ${ all _project } / ${ hierarchy } `
const URL = ` ${ BASE _OSPRO } /api/dashboard/get-invoice-outstanding/ ${ moment ( ) . format ( 'YYYY' ) } / ${ company _id } / ${ all _project } / ${ hierarchy } `
const result = await axios . get ( URL , HEADER ) . then ( res => res ) . catch ( err => err . response )
const result = await axios . get ( URL , HEADER ) . then ( res => res ) . catch ( err => err . response )
@ -501,8 +535,18 @@ const DashboardBOD = (props) => {
PROJECT _EXPENDITURE && PROJECT _EXPENDITURE . total _invoice ? Math . floor ( PROJECT _EXPENDITURE . total _invoice ) : 0 ,
PROJECT _EXPENDITURE && PROJECT _EXPENDITURE . total _invoice ? Math . floor ( PROJECT _EXPENDITURE . total _invoice ) : 0 ,
PROJECT _EXPENDITURE && PROJECT _EXPENDITURE . total _paid _invoice ? PROJECT _EXPENDITURE . total _paid _invoice : 0
PROJECT _EXPENDITURE && PROJECT _EXPENDITURE . total _paid _invoice ? PROJECT _EXPENDITURE . total _paid _invoice : 0
] ,
] ,
borderColor : [ '#480CA8' , '#B5179E' , '#A26A16' , '#4C4747' ] ,
borderColor : [
backgroundColor : [ '#480CA8' , '#B5179E' , '#A26A16' , '#4C4747' ] ,
PROJECT _EXPENDITURE _COLOR && PROJECT _EXPENDITURE _COLOR . total _budget && PROJECT _EXPENDITURE _COLOR . total _budget !== "" ? PROJECT _EXPENDITURE _COLOR . total _budget : '#480ca8' ,
PROJECT _EXPENDITURE _COLOR && PROJECT _EXPENDITURE _COLOR . total _expenditure && PROJECT _EXPENDITURE _COLOR . total _expenditure !== "" ? PROJECT _EXPENDITURE _COLOR . total _expenditure : '#b5179e' ,
PROJECT _EXPENDITURE _COLOR && PROJECT _EXPENDITURE _COLOR . total _invoice && PROJECT _EXPENDITURE _COLOR . total _invoice !== "" ? PROJECT _EXPENDITURE _COLOR . total _invoice : '#a26a16' ,
PROJECT _EXPENDITURE _COLOR && PROJECT _EXPENDITURE _COLOR . total _paid _invoice && PROJECT _EXPENDITURE _COLOR . total _paid _invoice !== "" ? PROJECT _EXPENDITURE _COLOR . total _paid _invoice : '#4c4747'
] ,
backgroundColor : [
PROJECT _EXPENDITURE _COLOR && PROJECT _EXPENDITURE _COLOR . total _budget && PROJECT _EXPENDITURE _COLOR . total _budget !== "" ? PROJECT _EXPENDITURE _COLOR . total _budget : '#480ca8' ,
PROJECT _EXPENDITURE _COLOR && PROJECT _EXPENDITURE _COLOR . total _expenditure && PROJECT _EXPENDITURE _COLOR . total _expenditure !== "" ? PROJECT _EXPENDITURE _COLOR . total _expenditure : '#b5179e' ,
PROJECT _EXPENDITURE _COLOR && PROJECT _EXPENDITURE _COLOR . total _invoice && PROJECT _EXPENDITURE _COLOR . total _invoice !== "" ? PROJECT _EXPENDITURE _COLOR . total _invoice : '#a26a16' ,
PROJECT _EXPENDITURE _COLOR && PROJECT _EXPENDITURE _COLOR . total _paid _invoice && PROJECT _EXPENDITURE _COLOR . total _paid _invoice !== "" ? PROJECT _EXPENDITURE _COLOR . total _paid _invoice : '#4c4747'
] ,
borderRadius : 5 ,
borderRadius : 5 ,
borderSkipped : false
borderSkipped : false
}
}
@ -553,8 +597,16 @@ const DashboardBOD = (props) => {
PROJECT _BY _FINANCIAL _HEALTH && PROJECT _BY _FINANCIAL _HEALTH . warning ? PROJECT _BY _FINANCIAL _HEALTH . warning : '' ,
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' ] : ''
PROJECT _BY _FINANCIAL _HEALTH && PROJECT _BY _FINANCIAL _HEALTH [ 'on-budget' ] ? PROJECT _BY _FINANCIAL _HEALTH [ 'on-budget' ] : ''
] . filter ( value => value !== null ) ,
] . filter ( value => value !== null ) ,
borderColor : [ "#E80053" , "#FFD600" , "#52AC0B" , ] ,
borderColor : [
backgroundColor : [ "#E80053" , "#FFD600" , "#52AC0B" , ] ,
PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR . overrun && PROJECT _FINANCIAL _HEALTH _COLOR . overrun !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR . overrun : '#E80053' ,
PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR . warning && PROJECT _FINANCIAL _HEALTH _COLOR . warning !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR . warning : '#FFD600' ,
PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] && PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] : '#52AC0B'
] ,
backgroundColor : [
PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR . overrun && PROJECT _FINANCIAL _HEALTH _COLOR . overrun !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR . overrun : '#E80053' ,
PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR . warning && PROJECT _FINANCIAL _HEALTH _COLOR . warning !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR . warning : '#FFD600' ,
PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] && PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] : '#52AC0B'
] ,
borderWidth : 2 ,
borderWidth : 2 ,
borderSkipped : false
borderSkipped : false
} ,
} ,
@ -579,8 +631,16 @@ const DashboardBOD = (props) => {
PROJECT _BY _SCHEDULE _HEALTH && PROJECT _BY _SCHEDULE _HEALTH . warning ? PROJECT _BY _SCHEDULE _HEALTH . warning : '' ,
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' ] : ''
PROJECT _BY _SCHEDULE _HEALTH && PROJECT _BY _SCHEDULE _HEALTH [ 'on-schedule' ] ? PROJECT _BY _SCHEDULE _HEALTH [ 'on-schedule' ] : ''
] ,
] ,
borderColor : [ "#E80053" , "#FFD600" , "#52AC0B" ] ,
borderColor : [
backgroundColor : [ "#E80053" , "#FFD600" , "#52AC0B" ] ,
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] && PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] : '#E80053' ,
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR . warning && PROJECT _SCHEDULE _HEALTH _COLOR . warning !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR . warning : '#FFD600' ,
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] && PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] : '#52AC0B'
] ,
backgroundColor : [
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] && PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] : '#E80053' ,
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR . warning && PROJECT _SCHEDULE _HEALTH _COLOR . warning !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR . warning : '#FFD600' ,
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] && PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] : '#52AC0B'
] ,
borderWidth : 2 ,
borderWidth : 2 ,
borderSkipped : false
borderSkipped : false
} ,
} ,
@ -740,9 +800,6 @@ const DashboardBOD = (props) => {
datasets : [
datasets : [
{
{
label : "" ,
label : "" ,
// data: [3, 1, 2, 3, 7],
// borderColor: ["#F74B25", "#B5179E", "#7209B7", "#023E8A", "#3B009A"],
// backgroundColor: ["#F74B25", "#B5179E", "#7209B7", "#023E8A", "#3B009A"],
data : PROJECT _BY _PHASE ? PROJECT _BY _PHASE . map ( ( item , idx ) => item . totalProject ) : [ ] ,
data : PROJECT _BY _PHASE ? PROJECT _BY _PHASE . map ( ( item , idx ) => item . totalProject ) : [ ] ,
borderColor : PROJECT _BY _PHASE ? PROJECT _BY _PHASE . map ( ( item , idx ) => item . color ) : [ ] ,
borderColor : PROJECT _BY _PHASE ? PROJECT _BY _PHASE . map ( ( item , idx ) => item . color ) : [ ] ,
backgroundColor : PROJECT _BY _PHASE ? PROJECT _BY _PHASE . map ( ( item , idx ) => item . color ) : [ ] ,
backgroundColor : PROJECT _BY _PHASE ? PROJECT _BY _PHASE . map ( ( item , idx ) => item . color ) : [ ] ,
@ -835,27 +892,21 @@ const DashboardBOD = (props) => {
}
}
} }
} }
data = { {
data = { {
// labels: ["Gedung Tenaga Panel Surya", "Pembangunan Gedung Tower ABC", "Tower Jaringan Jawa Barat", "Tower Jaringan Jawa Timur", "Tower Jaringan Jawa Tengah", "Tower Jaringan Bali", "Project Tower ABC", "Tower Jaringan DKI Jakarta", "Tower Jaringan NTT"],
// labels: [["Gedung Tenaga", "Panel Surya"], ["Pembangunan Gedung", "Tower ABC"], ["Tower Jaringan", "Jawa Barat"], ["Tower Jaringan", "Jawa Timur"], ["Tower Jaringan", "Jawa Tengah"], "Tower Jaringan Bali", "Project Tower ABC", ["Tower Jaringan", "DKI Jakarta"], "Tower Jaringan NTT"],
labels : PROJECT _INVOICE _VS _CASH _IN ? PROJECT _INVOICE _VS _CASH _IN . map ( ( item , idx ) => item . project _code ) : [ ] ,
labels : PROJECT _INVOICE _VS _CASH _IN ? PROJECT _INVOICE _VS _CASH _IN . map ( ( item , idx ) => item . project _code ) : [ ] ,
datasets : [
datasets : [
{
{
label : "Invoiced" ,
label : "Invoiced" ,
// data: [16, 8, 12, 10, 13, 12, 10, 10, 8],
data : PROJECT _INVOICE _VS _CASH _IN ? PROJECT _INVOICE _VS _CASH _IN . map ( ( item , idx ) => Math . floor ( item . invoiced ) ) : [ ] ,
data : PROJECT _INVOICE _VS _CASH _IN ? PROJECT _INVOICE _VS _CASH _IN . map ( ( item , idx ) => Math . floor ( item . invoiced ) ) : [ ] ,
borderColor : '#A36A16' ,
borderColor : PROJECT _INVOICE _COLOR && PROJECT _INVOICE _COLOR . invoiced && PROJECT _INVOICE _COLOR . invoiced !== "" ? PROJECT _INVOICE _COLOR . invoiced : '#A36A16' ,
backgroundColor : '#A36A16' ,
backgroundColor : PROJECT _INVOICE _COLOR && PROJECT _INVOICE _COLOR . invoiced && PROJECT _INVOICE _COLOR . invoiced !== "" ? PROJECT _INVOICE _COLOR . invoiced : '#A36A16' ,
// borderWidth: 2,
borderRadius : 5 ,
borderRadius : 5 ,
borderSkipped : false
borderSkipped : false
} ,
} ,
{
{
label : "Cash In" ,
label : "Cash In" ,
// data: [1, 1, 7, 6, 10, 9.5, 8, 9, 7.5],
data : PROJECT _INVOICE _VS _CASH _IN ? PROJECT _INVOICE _VS _CASH _IN . map ( ( item , idx ) => item . paid ) : [ ] ,
data : PROJECT _INVOICE _VS _CASH _IN ? PROJECT _INVOICE _VS _CASH _IN . map ( ( item , idx ) => item . paid ) : [ ] ,
borderColor : '#4C4747' ,
borderColor : PROJECT _INVOICE _COLOR && PROJECT _INVOICE _COLOR . paid && PROJECT _INVOICE _COLOR . paid !== "" ? PROJECT _INVOICE _COLOR . paid : '#4C4747' ,
backgroundColor : '#4C4747' ,
backgroundColor : PROJECT _INVOICE _COLOR && PROJECT _INVOICE _COLOR . paid && PROJECT _INVOICE _COLOR . paid !== "" ? PROJECT _INVOICE _COLOR . paid : '#4C4747' ,
// borderWidth: 2,
borderRadius : 5 ,
borderRadius : 5 ,
borderSkipped : false
borderSkipped : false
}
}
@ -891,39 +942,48 @@ const DashboardBOD = (props) => {
datasets : [
datasets : [
{
{
label : healthPerDivisionMode === 'schedule' ? "Behind Schedule" : "Overrun" ,
label : healthPerDivisionMode === 'schedule' ? "Behind Schedule" : "Overrun" ,
// data: [1, 0, 0, 0],
data : healthPerDivisionMode === 'schedule' ?
data : healthPerDivisionMode === 'schedule' ?
PROJECT _SCHEDULE _HEALTH _PER _DIVISION ? PROJECT _SCHEDULE _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . scheduleData . behindSchedule ) : [ ]
PROJECT _SCHEDULE _HEALTH _PER _DIVISION ? PROJECT _SCHEDULE _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . scheduleData . behindSchedule ) : [ ]
: PROJECT _BUDGET _HEALTH _PER _DIVISION ? PROJECT _BUDGET _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . budgetData . overrun ) : [ ]
: PROJECT _BUDGET _HEALTH _PER _DIVISION ? PROJECT _BUDGET _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . budgetData . overrun ) : [ ]
,
,
borderColor : '#E80053' ,
borderColor : healthPerDivisionMode === 'schedule' ?
backgroundColor : '#E80053' ,
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] && PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] : '#E80053'
: PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR . overrun && PROJECT _FINANCIAL _HEALTH _COLOR . overrun !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR . overrun : '#E80053' ,
backgroundColor : healthPerDivisionMode === 'schedule' ?
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] && PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR [ 'behind-schedule' ] : '#E80053'
: PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR . overrun && PROJECT _FINANCIAL _HEALTH _COLOR . overrun !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR . overrun : '#E80053' ,
borderWidth : 2 ,
borderWidth : 2 ,
borderRadius : 5 ,
borderRadius : 5 ,
borderSkipped : false
borderSkipped : false
} ,
} ,
{
{
label : healthPerDivisionMode === 'schedule' ? "Early Warning" : "Warning" ,
label : healthPerDivisionMode === 'schedule' ? "Early Warning" : "Warning" ,
// data: [2, 0, 1, 1],
data : healthPerDivisionMode === 'schedule' ?
data : healthPerDivisionMode === 'schedule' ?
PROJECT _SCHEDULE _HEALTH _PER _DIVISION ? PROJECT _SCHEDULE _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . scheduleData . warning ) : [ ]
PROJECT _SCHEDULE _HEALTH _PER _DIVISION ? PROJECT _SCHEDULE _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . scheduleData . warning ) : [ ]
: PROJECT _BUDGET _HEALTH _PER _DIVISION ? PROJECT _BUDGET _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . budgetData . warning ) : [ ]
: PROJECT _BUDGET _HEALTH _PER _DIVISION ? PROJECT _BUDGET _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . budgetData . warning ) : [ ]
,
,
borderColor : '#FFD600' ,
borderColor : healthPerDivisionMode === 'schedule' ?
backgroundColor : '#FFD600' ,
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR . warning && PROJECT _SCHEDULE _HEALTH _COLOR . warning !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR . warning : '#FFD600'
: PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR . warning && PROJECT _FINANCIAL _HEALTH _COLOR . warning !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR . warning : '#FFD600' ,
backgroundColor : healthPerDivisionMode === 'schedule' ?
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR . warning && PROJECT _SCHEDULE _HEALTH _COLOR . warning !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR . warning : '#FFD600'
: PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR . warning && PROJECT _FINANCIAL _HEALTH _COLOR . warning !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR . warning : '#FFD600' ,
borderWidth : 2 ,
borderWidth : 2 ,
borderRadius : 5 ,
borderRadius : 5 ,
borderSkipped : false
borderSkipped : false
} ,
} ,
{
{
label : healthPerDivisionMode === 'schedule' ? "On Schedule" : "On Budget" ,
label : healthPerDivisionMode === 'schedule' ? "On Schedule" : "On Budget" ,
// data: [4, 2, 3, 1],
data : healthPerDivisionMode === 'schedule' ?
data : healthPerDivisionMode === 'schedule' ?
PROJECT _SCHEDULE _HEALTH _PER _DIVISION ? PROJECT _SCHEDULE _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . scheduleData . onSchedule ) : [ ]
PROJECT _SCHEDULE _HEALTH _PER _DIVISION ? PROJECT _SCHEDULE _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . scheduleData . onSchedule ) : [ ]
: PROJECT _BUDGET _HEALTH _PER _DIVISION ? PROJECT _BUDGET _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . budgetData [ 'on-budget' ] ) : [ ]
: PROJECT _BUDGET _HEALTH _PER _DIVISION ? PROJECT _BUDGET _HEALTH _PER _DIVISION . map ( ( item , idx ) => item . budgetData [ 'on-budget' ] ) : [ ]
,
,
borderColor : '#52AC0B' ,
borderColor : healthPerDivisionMode === 'schedule' ?
backgroundColor : '#52AC0B' ,
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] && PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] : '#52AC0B'
: PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] && PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] : '#52AC0B' ,
backgroundColor : healthPerDivisionMode === 'schedule' ?
PROJECT _SCHEDULE _HEALTH _COLOR && PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] && PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] !== "" ? PROJECT _SCHEDULE _HEALTH _COLOR [ 'on-schedule' ] : '#52AC0B'
: PROJECT _FINANCIAL _HEALTH _COLOR && PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] && PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] !== "" ? PROJECT _FINANCIAL _HEALTH _COLOR [ 'on-budget' ] : '#52AC0B' ,
borderWidth : 2 ,
borderWidth : 2 ,
borderRadius : 5 ,
borderRadius : 5 ,
borderSkipped : false
borderSkipped : false