feat: update ComparisonResult and EnergyUsage components with new chart layouts and styling adjustments

This commit is contained in:
Nalvazhuthi 2025-05-28 10:57:10 +05:30
parent 3f3e6d4f14
commit db46327249
3 changed files with 62 additions and 22 deletions

View File

@ -100,7 +100,12 @@ const ComparisonResult = () => {
<div className="key">mins</div> <div className="key">mins</div>
</div> </div>
</div> </div>
<div className="chart"></div> <div className="chart">
<div className="vertical-chart">
<div className="layout1"></div>
<div className="layout2"></div>
</div>
</div>
</div> </div>
</div> </div>

View File

@ -1,4 +1,4 @@
import React from "react"; import React, { useMemo } from "react";
import { Line } from "react-chartjs-2"; import { Line } from "react-chartjs-2";
import { import {
Chart as ChartJS, Chart as ChartJS,
@ -42,31 +42,35 @@ const EnergyUsage = () => {
], ],
}; };
const options = { const options = useMemo(
responsive: true, () => ({
plugins: { responsive: true,
legend: { maintainAspectRatio: false,
display: false, // Hide legend plugins: {
}, title: {
tooltip: { display: true,
enabled: false, // Hide tooltips },
}, legend: {
},
scales: {
x: {
display: false, // Hide x-axis
grid: {
display: false, display: false,
}, },
}, },
y: { scales: {
display: false, // Hide y-axis x: {
grid: { display: false, // Hide x-axis
display: false, grid: {
display: false,
},
},
y: {
display: false, // Hide y-axis
grid: {
display: false,
},
}, },
}, },
}, }),
}; []
);
return ( return (
<div className="comparisionCard energy-usage"> <div className="comparisionCard energy-usage">

View File

@ -481,10 +481,13 @@
} }
.chart { .chart {
height: 100%;
width: 90%; width: 90%;
position: absolute; position: absolute;
top: 10px; top: 10px;
left: 0; left: 0;
margin-bottom: 20px;
padding: 20px;
} }
} }
@ -556,6 +559,9 @@
.overallDowntime-container { .overallDowntime-container {
.totalDownTime-wrapper { .totalDownTime-wrapper {
display: flex; display: flex;
height: auto;
width: 100%;
justify-content: space-between;
.totalDownTime { .totalDownTime {
width: 70%; width: 70%;
@ -589,8 +595,33 @@
} }
.chart { .chart {
height: auto;
width: 30%; width: 30%;
width: 20px;
position: relative; position: relative;
perspective: 800px;
/* Enables 3D viewing */
.vertical-chart {
height: 100%;
display: flex;
flex-direction: column-reverse;
gap: 6px;
.layout2 {
transform-style: preserve-3d;
transform: rotateX(15deg);
/* 3D tilt */
height: 20%;
background-color: #F3A60D;
}
.layout1 {
height: 80%;
background-color: #6F42C1;
}
}
} }
} }
} }