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>
</div>
<div className="chart"></div>
<div className="chart">
<div className="vertical-chart">
<div className="layout1"></div>
<div className="layout2"></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 {
Chart as ChartJS,
@ -42,14 +42,16 @@ const EnergyUsage = () => {
],
};
const options = {
const options = useMemo(
() => ({
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false, // Hide legend
title: {
display: true,
},
tooltip: {
enabled: false, // Hide tooltips
legend: {
display: false,
},
},
scales: {
@ -66,7 +68,9 @@ const EnergyUsage = () => {
},
},
},
};
}),
[]
);
return (
<div className="comparisionCard energy-usage">

View File

@ -481,10 +481,13 @@
}
.chart {
height: 100%;
width: 90%;
position: absolute;
top: 10px;
left: 0;
margin-bottom: 20px;
padding: 20px;
}
}
@ -556,6 +559,9 @@
.overallDowntime-container {
.totalDownTime-wrapper {
display: flex;
height: auto;
width: 100%;
justify-content: space-between;
.totalDownTime {
width: 70%;
@ -589,8 +595,33 @@
}
.chart {
height: auto;
width: 30%;
width: 20px;
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;
}
}
}
}
}