diff --git a/app/src/components/ui/compareVersion/ComparisonResult.tsx b/app/src/components/ui/compareVersion/ComparisonResult.tsx
index 619738f..031fc1a 100644
--- a/app/src/components/ui/compareVersion/ComparisonResult.tsx
+++ b/app/src/components/ui/compareVersion/ComparisonResult.tsx
@@ -1,8 +1,52 @@
-import React from "react";
+import React, { useMemo } from "react";
import PerformanceResult from "./result-card/PerformanceResult";
import EnergyUsage from "./result-card/EnergyUsage";
+import { Bar } from "react-chartjs-2";
const ComparisonResult = () => {
+ const defaultData = {
+ labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
+ datasets: [
+ {
+ label: "Dataset",
+ data: [12, 19, 3, 5, 2, 3],
+ backgroundColor: ["#6f42c1"],
+ borderColor: "#b392f0",
+ borderWidth: 1,
+ },
+ ],
+ };
+
+ // Memoize Chart Options
+ const options = useMemo(
+ () => ({
+ responsive: true,
+ maintainAspectRatio: false,
+ plugins: {
+ title: {
+ display: true,
+ },
+ legend: {
+ display: false,
+ },
+ },
+ scales: {
+ x: {
+ display: false, // Hide x-axis
+ grid: {
+ display: false,
+ },
+ },
+ y: {
+ display: false, // Hide y-axis
+ grid: {
+ display: false,
+ },
+ },
+ },
+ }),
+ []
+ );
return (
Performance Comparison
@@ -45,24 +89,34 @@ const ComparisonResult = () => {
Overall Downtime
-
-
-
Total down time
-
(Simulation 1)
-
-
-
17
-
mins
+
+
+
+
Total down time
+
(Simulation 1)
+
+
+
Overall Scrap Rate
-
-
Layout 1
-
Total scrap produced by
-
2.7 ton
+
+
+
Layout 1
+
+ Total scrap produced by
+
+
2.7 ton
+
+
+
+
diff --git a/app/src/styles/layout/compareLayout.scss b/app/src/styles/layout/compareLayout.scss
index f897f07..eabc4e7 100644
--- a/app/src/styles/layout/compareLayout.scss
+++ b/app/src/styles/layout/compareLayout.scss
@@ -554,41 +554,69 @@
}
.overallDowntime-container {
- .totalDownTime {
- background: var(--background-color-secondary);
- backdrop-filter: blur(20px);
- border-radius: 12px;
- width: fit-content;
+ .totalDownTime-wrapper {
display: flex;
- justify-content: space-between;
- align-items: center;
- gap: 20px;
- padding: 8px 10px;
- margin: 44px 0;
- .totalDownTime-right {
+ .totalDownTime {
+ width: 70%;
+ background: var(--background-color-secondary);
+ backdrop-filter: blur(20px);
+ border-radius: 12px;
+
display: flex;
- flex-direction: column;
- gap: 6px;
+ justify-content: space-between;
+ align-items: center;
+ gap: 20px;
+ padding: 8px 10px;
+ margin: 44px 0;
+
+ .totalDownTime-right {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ }
+
+ .totalDownTime-left {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+
+ .value {
+ font-size: var(--font-size-xlarge);
+ color: var(--background-color-button);
+ }
+ }
}
- .totalDownTime-left {
- display: flex;
- gap: 6px;
-
- .value {
- font-size: var(--font-size-xlarge);
- color: var(--background-color-button);
- }
+ .chart {
+ width: 30%;
+ position: relative;
}
}
}
.overallScrapRate {
- .overallScrapRate-value {
+ .overallScrapRate-wrapper {
display: flex;
- flex-direction: column;
- gap: 6px;
- margin: 40px 0;
+
+ .overallScrapRate-value {
+ width: 50%;
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ margin: 40px 0;
+
+ .overallScrapRate-key {
+
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+
+ .chart {
+ width: 50%;
+ position: relative;
+ }
}
}
\ No newline at end of file