Skip to content

Commit ae83400

Browse files
committed
Updated the revenue chart to a stylish and modern look
1 parent 922d093 commit ae83400

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

frontend/src/components/Dashboard/RevenueChart.jsx

+23-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const RevenueChart = () => {
2626

2727
const isMobile = windowWidth < 768;
2828
const labelFontSize = isMobile ? '9px' : '13px';
29-
const barThicknessSize = isMobile ? '25' : '40';
29+
const barThicknessSize = isMobile ? '25' : '30';
3030

3131

3232
const data = {
@@ -39,15 +39,35 @@ const RevenueChart = () => {
3939
],
4040
backgroundColor: '#84D187',
4141
hoverBackgroundColor: '#00B207',
42-
barThickness: barThicknessSize
42+
barThickness: barThicknessSize,
43+
borderRadius: { topLeft: 5, topRight: 5, bottomLeft: 5, bottomRight: 5 }, // Rounded on all sides
44+
borderSkipped: false, // Ensures full rounding effect
45+
order: 1,
46+
},
47+
{
48+
label: '', // Invisible padding dataset
49+
data: Array(12).fill(15), // Adds vertical spacing (adjust as needed)
50+
backgroundColor: 'rgba(0,0,0,0)', // Fully transparent
51+
barThickness: barThicknessSize,
52+
order: 2,
4353
},
4454
{
4555
label: 'Loss',
4656
data: [
4757
15, 0, 25, 50, 0, 100, 10, 0, 80, 0, 0, 0
4858
],
4959
backgroundColor: '#EDF2EE',
50-
barThickness: barThicknessSize
60+
barThickness: barThicknessSize,
61+
borderRadius: 5,
62+
borderSkipped: false, // Keeps the bars visually clean
63+
order: 3,
64+
},
65+
{
66+
label: '', // Invisible padding dataset
67+
data: Array(12).fill(20), // Adds vertical spacing (adjust as needed)
68+
backgroundColor: 'rgba(0,0,0,0)', // Fully transparent
69+
barThickness: barThicknessSize,
70+
order: 0,
5171
},
5272
],
5373
};

0 commit comments

Comments
 (0)