-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcharts.html
195 lines (159 loc) · 7.67 KB
/
charts.html
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!doctype html>
<html data-bs-theme="white" lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1 user-scalable=0" name="viewport">
<title>Charts - CleanEmon</title>
<meta name="description" content="Clean Emon lets you view disaggregated energy consumption data for home appliances.">
<meta name=”robots” content="noindex, follow">
<meta name="keywords" content="CleanEmon, energy consumption, home appliances consumption, non intrusive load monitoring">
<meta name="author" content="Konstantinos Mazgaltzidis">
<link crossorigin="anonymous" href="css/bootstrap.min.css"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" rel="stylesheet">
<link crossorigin="anonymous" href="custom_style.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="manifest" href="manifest.json">
<script>
function isDarkModeEnabled() {
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
}
if (isDarkModeEnabled()) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
const newColorScheme = event.matches ? "dark" : "light";
document.documentElement.setAttribute('data-bs-theme', newColorScheme)
});
</script>
</head>
<body>
<nav class="navbar bg-body-tertiary ">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="logo.svg" alt="Logo" height="34">
CleanEmon</a>
Charts
</div>
</nav>
<div class="container">
<div class="row align-items-center justify-content-end">
<div class="col">
<p class="fs-1 text-success text-nowrap"><i class="material-icons align-middle">history show_chart</i> Consumption history</p>
</div>
<div class="col col-auto">
<div class="btn-group-toggle" data-toggle="buttons">
<input type="radio" class="btn-check" name="inlineRadioOptions" id="inlineRadio1" value="360" autocomplete="off">
<label class="btn btn-outline-primary" for="inlineRadio1">1Y</label>
<input type="radio" class="btn-check" name="inlineRadioOptions" id="inlineRadio2" value="180" autocomplete="off">
<label class="btn btn-outline-primary" for="inlineRadio2">6M</label>
<input type="radio" class="btn-check" name="inlineRadioOptions" id="inlineRadio3" value="90" autocomplete="off">
<label class="btn btn-outline-primary" for="inlineRadio3">3M</label>
<input type="radio" class="btn-check" name="inlineRadioOptions" id="inlineRadio4" value="30" autocomplete="off">
<label class="btn btn-outline-primary" for="inlineRadio4">1M</label>
<input type="radio" class="btn-check" name="inlineRadioOptions" id="inlineRadio5" value="7" autocomplete="off" checked>
<label class="btn btn-outline-primary" for="inlineRadio5">1W</label>
</div>
</div>
</div>
<div id="image-placeholder_consumption_history" class="d-flex justify-content-center">
</div>
<div class="chart-container" style="position: relative;">
<canvas id="consumption_history_canvas"></canvas>
</div>
<div class="row align-items-center justify-content-start ">
<div class="col">
<p class="fs-1 text-success"><i class="material-icons align-middle">today show_chart</i> Single Day View</p>
</div>
</div>
<div>
<div class="form-floating">
<input type="date" class="form-control" id="date_picker" placeholder="Date">
<label for="date_picker">Date</label>
</div>
<div id="image-placeholder" class="d-flex justify-content-center">
</div>
</div>
<div>
<canvas id="dayChart"></canvas>
</div>
<div class="row align-items-center justify-content-end">
<div class="col">
<p class="fs-2 text-success text-nowrap"><i class="material-icons align-middle">show_chart</i> Appliances Consumptions</p>
</div>
</div>
<div class="row align-items-center">
<div class="col">
<div class="form-floating">
<input type="date" class="form-control" id="appliances_date_picker_start" placeholder="Date">
<label for="appliances_date_picker_start">Start date</label>
</div>
</div>
<div class="col">
<div class="form-floating">
<input type="date" class="form-control" id="appliances_date_picker_end" placeholder="Date">
<label for="appliances_date_picker_end">End date</label>
</div>
</div>
<div class = "col-auto">
<button type="button" class="btn btn-primary btn-lg" id="button_query_appliances_consumptions"><i class="material-icons align-middle">query_stats</i></button>
</div>
</div>
<div>
<canvas id="appliancesChart"></canvas>
</div>
<div class="row mt-3">
<div id="Appliances_Consumptions_list">
Please select a data range
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>-->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-zoom/2.0.1/chartjs-plugin-zoom.min.js" integrity="sha512-wUYbRPLV5zs6IqvWd88HIqZU/b8TBx+I8LEioQ/UC0t5EMCLApqhIAnUg7EsAzdbhhdgW07TqYDdH3QEXRcPOQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>-->
</div>
<nav class="nav">
<a class="nav__link" href="index.html">
<i class="material-icons nav__icon">feed</i>
<span class="nav__text">Dashboard</span>
</a>
<a class="nav__link nav__link--active" href="charts.html">
<i class="material-icons nav__icon">bar_chart</i>
<span class="nav__text">Charts</span>
</a>
<a class="nav__link" href="metadata.html">
<i class="material-icons nav__icon">info</i>
<span class="nav__text">Metadata</span>
</a>
<a class="nav__link" href="settings.html">
<i class="material-icons nav__icon">settings</i>
<span class="nav__text">Settings</span>
</a>
</nav>
<script crossorigin="anonymous"
integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
src="js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.min.js"></script>
<script type="module" src="code/modal.js"></script>
<script type="module" src="code/charts.js"></script>
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js', { scope: '/' }).then(reg => {
reg.addEventListener('updatefound', () => {
const newWorker = reg.installing;
newWorker.addEventListener('statechange', () => {
if (newWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// Show update pop-up
console.log('New content is available; please refresh.');
} else {
console.log('Content is cached for offline use.');
}
}
});
});
}).catch(error => {
console.error('Error during service worker registration:', error);
});
}
</script>
</body>
</html>