@@ -231,26 +231,42 @@ <h5 class="mb-0">Recent Activity</h5>
231231
232232 // Balance Chart
233233 const ctx = document . getElementById ( 'balanceChart' ) . getContext ( '2d' ) ;
234+ const is_admin = window . location . pathname . includes ( '/wallet/admin' ) ;
234235 const balanceChart = new Chart ( ctx , {
235236 type : 'doughnut' ,
236237 data : {
237- labels : [ 'Your Balance' , 'In Circulation (Others)' , 'Available in Bank' ] ,
238+ labels : is_admin ? [ 'In Circulation' , 'Not in Circulation' ] : [ 'Your Balance' , 'In Circulation (Others)' , 'Available in Bank' ] ,
238239 datasets : [ {
239- data : [
240- { { user . current_currency } } ,
241- { { total_used - user . current_currency } } ,
242- { { settings . maximum_currency - total_used } }
243- ] ,
244- backgroundColor : [
245- 'rgba(54, 162, 235, 0.8)' ,
246- 'rgba(255, 159, 64, 0.8)' ,
247- 'rgba(75, 192, 192, 0.8)'
248- ] ,
249- borderColor : [
250- 'rgba(54, 162, 235, 1)' ,
251- 'rgba(255, 159, 64, 1)' ,
252- 'rgba(75, 192, 192, 1)'
253- ] ,
240+ data : is_admin
241+ ? [
242+ { { total_used } } ,
243+ { { settings . maximum_currency - total_used } }
244+ ]
245+ : [
246+ { { user . current_currency } } ,
247+ { { total_used - user . current_currency } } ,
248+ { { settings . maximum_currency - total_used } }
249+ ] ,
250+ backgroundColor : is_admin
251+ ? [
252+ 'rgba(255, 159, 64, 0.8)' ,
253+ 'rgba(75, 192, 192, 0.8)'
254+ ]
255+ : [
256+ 'rgba(54, 162, 235, 0.8)' ,
257+ 'rgba(255, 159, 64, 0.8)' ,
258+ 'rgba(75, 192, 192, 0.8)'
259+ ] ,
260+ borderColor : is_admin
261+ ? [
262+ 'rgba(255, 159, 64, 1)' ,
263+ 'rgba(75, 192, 192, 1)'
264+ ]
265+ : [
266+ 'rgba(54, 162, 235, 1)' ,
267+ 'rgba(255, 159, 64, 1)' ,
268+ 'rgba(75, 192, 192, 1)'
269+ ] ,
254270 borderWidth : 1
255271 } ]
256272 } ,
0 commit comments