@@ -81,10 +81,10 @@ function HoursPledgedChart() {
8181
8282 const processedData = Object . values ( roleMap ) . map ( roleData => ( {
8383 role : roleData . role ,
84- avgHours : roleData . totalHours / roleData . count ,
84+ avgHours : ( roleData . totalHours / roleData . count ) . toFixed ( 2 ) ,
8585 } ) ) ;
8686
87- processedData . sort ( ( a , b ) => b . avgHours - a . avgHours ) ;
87+ processedData . sort ( ( a , b ) => Number ( b . avgHours ) - Number ( a . avgHours ) ) ;
8888 setChartData ( processedData ) ;
8989 } , [ rawData , startDate , endDate , selectedRoles ] ) ;
9090
@@ -124,9 +124,48 @@ function HoursPledgedChart() {
124124 onChange = { setSelectedRoles }
125125 placeholder = "Select Roles"
126126 styles = { {
127+ control : base => ( {
128+ ...base ,
129+ backgroundColor : darkMode ? '#1c2541' : base . backgroundColor ,
130+ } ) ,
131+ menu : base => ( {
132+ ...base ,
133+ backgroundColor : darkMode ? '#1c2541' : base . backgroundColor ,
134+ } ) ,
135+ option : ( base , state ) => ( {
136+ ...base ,
137+ backgroundColor : darkMode
138+ ? state . isFocused
139+ ? '#47526dff'
140+ : '#1c2541'
141+ : base . backgroundColor ,
142+ color : darkMode ? '#ffffff' : base . color ,
143+ } ) ,
127144 placeholder : base => ( {
128145 ...base ,
129- color : 'black' ,
146+ color : darkMode ? '#ffffff' : base . color ,
147+ } ) ,
148+ input : base => ( {
149+ ...base ,
150+ color : darkMode ? '#ffffff' : base . color ,
151+ } ) ,
152+ multiValue : base => ( {
153+ ...base ,
154+ backgroundColor : darkMode ? '#47526d' : base . backgroundColor ,
155+ } ) ,
156+
157+ multiValueLabel : base => ( {
158+ ...base ,
159+ color : darkMode ? '#ffffff' : base . color ,
160+ } ) ,
161+
162+ multiValueRemove : base => ( {
163+ ...base ,
164+ color : darkMode ? '#ffffff' : base . color ,
165+ ':hover' : {
166+ backgroundColor : darkMode ? '#5a6a85' : base [ ':hover' ] ?. backgroundColor ,
167+ color : '#ffffff' ,
168+ } ,
130169 } ) ,
131170 } }
132171 />
@@ -147,24 +186,35 @@ function HoursPledgedChart() {
147186 height = { 400 }
148187 data = { chartData }
149188 layout = "vertical"
150- margin = { { top : 20 , right : 30 , left : 100 , bottom : 20 } }
189+ margin = { { top : 20 , right : 80 , left : 100 , bottom : 60 } }
151190 >
152191 < CartesianGrid strokeDasharray = "3 3" />
153- < XAxis type = "number" dataKey = "avgHours" >
154- < Label value = "Average Hours Pledged" position = "insideBottom" offset = { - 10 } />
192+ < XAxis type = "number" dataKey = "avgHours" width = { 120 } tickMargin = { 15 } >
193+ < Label value = "Average Hours Pledged" position = "insideBottom" offset = { - 20 } dy = { 10 } />
155194 </ XAxis >
156- < YAxis type = "category" dataKey = "role" >
195+ < YAxis type = "category" dataKey = "role" width = { 120 } tickMargin = { 15 } >
157196 < Label
158197 value = "Name of Role"
159198 angle = { - 90 }
160199 position = "outsideCenter"
161200 offset = { - 20 }
162- dx = { - 50 }
201+ dx = { - 70 }
163202 />
164203 </ YAxis >
165- < Tooltip />
166- < Bar dataKey = "avgHours" fill = { darkMode ? '#225163' : '#8884d8' } >
167- < LabelList dataKey = "avgHours" position = "right" />
204+ < Tooltip
205+ contentStyle = { {
206+ backgroundColor : darkMode ? '#1c2541' : '#ffffff' ,
207+ color : darkMode ? '#ffffff' : '#000000' ,
208+ } }
209+ labelStyle = { {
210+ color : darkMode ? '#ffffff' : '#000000' ,
211+ } }
212+ itemStyle = { {
213+ color : darkMode ? '#ffffff' : '#000000' ,
214+ } }
215+ />
216+ < Bar dataKey = "avgHours" fill = { darkMode ? '#9ca5f6ff' : '#8884d8' } >
217+ < LabelList dataKey = "avgHours" position = "right" formatter = { v => v } />
168218 </ Bar >
169219 </ BarChart >
170220 ) }
0 commit comments