@@ -80,6 +80,7 @@ export default function HoursCompletedBarChart({ isLoading, data, darkMode }) {
8080 color : [ 'rgba(76,75,245,255)' , 'rgba(0,175,244,255)' ] ,
8181 } ) ) ;
8282 const projectBarInfo = {
83+ ifcompare : projectChangePercentage !== undefined && projectChangePercentage !== null ,
8384 amount : projectHours . count ,
8485 percentage : `${ ( projectPercentage * 100 ) . toFixed ( 2 ) } %` ,
8586 change :
@@ -158,16 +159,22 @@ export default function HoursCompletedBarChart({ isLoading, data, darkMode }) {
158159 100 } % of Total Tangible Hours Submitted to Tasks`}
159160 </ span >
160161 { ( ( ) => {
161- const isPositive = data . hoursSubmittedToTasksComparisonPercentage >= 0 ;
162+ const percentage = data . hoursSubmittedToTasksComparisonPercentage ;
163+
164+ if ( percentage === undefined || percentage === null ) {
165+ // No comparison → hide metrics
166+ return null ;
167+ }
168+ const isPositive = percentage >= 0 ;
162169 let color ;
163170 if ( isPositive ) {
164171 color = darkMode ? 'lightgreen' : 'green' ;
165172 } else {
166173 color = 'red' ;
167174 }
168175 const value = isPositive
169- ? `+${ ( data . hoursSubmittedToTasksComparisonPercentage * 100 ) . toFixed ( 0 ) } %`
170- : `${ ( data . hoursSubmittedToTasksComparisonPercentage * 100 ) . toFixed ( 0 ) } %` ;
176+ ? `+${ ( percentage * 100 ) . toFixed ( 0 ) } %`
177+ : `${ ( percentage * 100 ) . toFixed ( 0 ) } %` ;
171178 return < span style = { { color, marginLeft : 8 , fontSize : '12px' } } > { value } </ span > ;
172179 } ) ( ) }
173180 </ div >
@@ -177,7 +184,7 @@ export default function HoursCompletedBarChart({ isLoading, data, darkMode }) {
177184 chartData = { chartData . filter ( item => item . name === 'Tasks' ) }
178185 maxY = { maxY }
179186 tickInterval = { tickInterval }
180- renderCustomizedLabel = { renderCustomizedLabel }
187+ // renderCustomizedLabel={renderCustomizedLabel}
181188 darkMode = { darkMode }
182189 projectBarInfo = { projectBarInfo }
183190 yAxisLabel = "Hours"
0 commit comments