-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathempty_rack_detection.html
More file actions
147 lines (135 loc) · 5.32 KB
/
empty_rack_detection.html
File metadata and controls
147 lines (135 loc) · 5.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=League+Spartan:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<title>Empty Rack Detection</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
body {
font-family: 'League Spartan', sans-serif;
background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
color: #ffffff;
text-align: center;
margin: 0;
padding: 0;
}
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 15px 30px;
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.37);
border-radius: 12px;
margin: 20px;
}
.logo {
font-size: 30px;
font-weight: bold;
color: white;
}
h2 {
font-size: 28px;
font-weight: bold;
margin: 20px 0;
}
.chart-container {
width: 80%;
max-width: 900px;
margin: auto;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
padding: 20px;
border-radius: 12px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.37);
margin-bottom: 30px;
height: 400px;
}
canvas {
display: block;
}
</style>
</head>
<body>
<!-- Navbar -->
<div class="navbar">
<div class="logo">Billiance</div>
</div>
<h2>📊 Empty Rack Detection - Monthly Analysis</h2>
<div class="chart-container">
<canvas id="emptyRackChart"></canvas>
</div>
<h2>🔥 Highest Sold Product Each Month (More Sales = More Empty Racks)</h2>
<div class="chart-container">
<canvas id="highestSoldChart"></canvas>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const labels = ['January', 'February', 'March', 'April', 'May', 'June'];
const productNames = ['Apples', 'Sunflower Oil', 'Baby Toys'];
const salesData = {
Apples: [30, 45, 25, 50, 40, 35],
SunflowerOil: [40, 30, 50, 45, 35, 25],
BabyToys: [20, 35, 40, 30, 50, 45]
};
const ctx1 = document.getElementById('emptyRackChart').getContext('2d');
new Chart(ctx1, {
type: 'bar',
data: {
labels: labels,
datasets: [
{ label: 'Apples', data: salesData.Apples, backgroundColor: '#ec4899', borderRadius: 6 },
{ label: 'Sunflower Oil', data: salesData.SunflowerOil, backgroundColor: '#302b63', borderRadius: 6 },
{ label: 'Baby Toys', data: salesData.BabyToys, backgroundColor: '#db2777', borderRadius: 6 }
]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: { beginAtZero: true, ticks: { color: '#ffffff', font: { size: 14 } } },
x: { ticks: { color: '#ffffff', font: { size: 14 } } }
},
plugins: {
legend: { labels: { color: '#ffffff', font: { size: 14 } } }
}
}
});
const highestSold = labels.map((month, i) => {
const sales = [salesData.Apples[i], salesData.SunflowerOil[i], salesData.BabyToys[i]];
const maxSale = Math.max(...sales);
const productIndex = sales.indexOf(maxSale);
return { label: `${month} - ${productNames[productIndex]}`, value: maxSale };
});
const ctx2 = document.getElementById('highestSoldChart').getContext('2d');
new Chart(ctx2, {
type: 'bar',
data: {
labels: highestSold.map(item => item.label),
datasets: [{
label: 'Highest Sold Product (More Sales = More Empty Racks)',
data: highestSold.map(item => item.value),
backgroundColor: '#ff9f00',
borderRadius: 6
}]
},
options: {
indexAxis: 'y',
responsive: true,
maintainAspectRatio: false,
scales: {
x: { beginAtZero: true, ticks: { color: '#ffffff', font: { size: 14 } } },
y: { ticks: { color: '#ffffff', font: { size: 14 } } }
},
plugins: {
legend: { labels: { color: '#ffffff', font: { size: 14 } } }
}
}
});
});
</script>
</body>
</html>