Skip to content

Commit bdc6de8

Browse files
committed
sundar_grouped_quantity_ofmaterials_used_improvemnts
1 parent efa29c2 commit bdc6de8

2 files changed

Lines changed: 25 additions & 8 deletions

File tree

src/components/BMDashboard/WeeklyProjectSummary/QuantityOfMaterialsUsed/QuantityOfMaterialsUsed.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ div.weekly-project-summary-card.normal-card .dropdown-item {
241241
.quantity-of-materials-used-card .custom-select__option--is-focused {
242242
background-color: var(--button-hover) !important;
243243
color: var(--card-bg) !important;
244+
overflow: visible !important;
245+
min-width: max-content;
244246
}
245247

246248
/* Placeholder text inside dropdown */

src/components/BMDashboard/WeeklyProjectSummary/QuantityOfMaterialsUsed/QuantityOfMaterialsUsed.jsx

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,18 @@ function QuantityOfMaterialsUsed({ data }) {
153153
};
154154

155155
useEffect(() => {
156-
setChartData(null);
157-
158156
if (!Array.isArray(data) || data.length === 0) {
159-
setTimeout(() => {
160-
setChartData({
161-
labels: [],
162-
datasets: [{ label: 'Quantity Used', data: [], backgroundColor: [] }],
163-
});
164-
}, 0);
157+
setChartData({
158+
labels: [],
159+
datasets: [
160+
{
161+
label: 'Quantity Used',
162+
data: [],
163+
backgroundColor: [],
164+
type: 'bar', // Explicitly define type
165+
},
166+
],
167+
});
165168
return;
166169
}
167170

@@ -764,6 +767,7 @@ function QuantityOfMaterialsUsed({ data }) {
764767
>
765768
<Bar
766769
data={chartData}
770+
key={uuidv4()}
767771
options={{
768772
maintainAspectRatio: false,
769773
responsive: true,
@@ -805,6 +809,17 @@ function QuantityOfMaterialsUsed({ data }) {
805809
},
806810
},
807811
},
812+
animation: {
813+
duration: 100,
814+
},
815+
type: 'bar',
816+
transitions: {
817+
active: {
818+
animation: {
819+
duration: 100,
820+
},
821+
},
822+
},
808823
}}
809824
/>
810825
</div>

0 commit comments

Comments
 (0)