Skip to content

Commit 2aa77c2

Browse files
Merge pull request #4684 from OneCommunityGlobal/fix-utilization-3882
uha fix utilization chart
2 parents e99e570 + 30f7f8e commit 2aa77c2

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/components/BMDashboard/UtilizationChart/UtilizationChart.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import axios from 'axios';
99
import styles from './UtilizationChart.module.css';
1010
import { useSelector } from 'react-redux';
1111
import { ENDPOINTS } from '../../../utils/URL';
12-
import ChartDataLabels from 'chartjs-plugin-datalabels';
1312

14-
ChartJS.register(BarElement, CategoryScale, LinearScale, Tooltip, Title, ChartDataLabels);
13+
ChartJS.register(BarElement, CategoryScale, LinearScale, Tooltip, Title);
1514

1615
function UtilizationChart() {
1716
const [toolsData, setToolsData] = useState([]);
@@ -79,7 +78,7 @@ function UtilizationChart() {
7978
{
8079
label: 'Utilization (%)',
8180
data: toolsData.map(tool => tool.utilizationRate),
82-
backgroundColor: darkMode ? '#007bff' : '#a0e7e5',
81+
backgroundColor: '#007bff',
8382
borderRadius: 6,
8483
},
8584
],
@@ -93,10 +92,11 @@ function UtilizationChart() {
9392
labels: { color: darkMode ? '#ffffff' : '#333' },
9493
},
9594
datalabels: {
96-
color: darkMode ? '#ffffff' : '#333',
95+
color: darkMode ? '#ffffff' : '#333333',
9796
anchor: 'end',
9897
align: 'end',
9998
font: {
99+
weight: 'bold',
100100
size: 12,
101101
},
102102
formatter: (_, context) => {
@@ -105,13 +105,14 @@ function UtilizationChart() {
105105
},
106106
},
107107
tooltip: {
108+
titleColor: '#ffffff',
109+
bodyColor: '#ffffff',
108110
callbacks: {
109111
label: context => {
110112
const tool = toolsData[context.dataIndex];
111113
return `Utilization: ${tool.utilizationRate}%, Downtime: ${tool.downtime} hrs`;
112114
},
113115
},
114-
footerColor: 'white',
115116
},
116117
},
117118
scales: {
@@ -174,16 +175,13 @@ function UtilizationChart() {
174175
selected={startDate}
175176
onChange={date => setStartDate(date)}
176177
placeholderText="Start Date"
177-
maxDate={endDate || '' || new Date()}
178178
className={styles.datepickerWrapper}
179179
/>
180180

181181
<DatePicker
182182
selected={endDate}
183183
onChange={date => setEndDate(date)}
184184
placeholderText="End Date"
185-
minDate={startDate || ''}
186-
maxDate={new Date()}
187185
className={styles.datepickerWrapper}
188186
/>
189187

src/components/BMDashboard/UtilizationChart/UtilizationChart.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
}
9191

9292
.button {
93-
background-color: var(--button-bg, #000);
93+
background-color: #2563eb;
9494
color: var(--button-text, #fff);
9595
border: none;
9696
cursor: pointer;
@@ -99,7 +99,7 @@
9999
}
100100

101101
.button:hover {
102-
background-color: var(--button-hover, #333);
102+
background-color: #1d4ed8;
103103
}
104104

105105
.utilizationChartError {

0 commit comments

Comments
 (0)