Update plot_week.html
Browse files- plot_week.html +13 -23
plot_week.html
CHANGED
@@ -133,7 +133,7 @@ body {
|
|
133 |
mode: "lines+markers",
|
134 |
line: { color: color },
|
135 |
hovertemplate: data.days_of_week.map((day, index) =>
|
136 |
-
|
137 |
)
|
138 |
}], {
|
139 |
title: title,
|
@@ -143,12 +143,12 @@ body {
|
|
143 |
showlegend: false
|
144 |
});
|
145 |
}
|
146 |
-
createChart("ph_chart", data.ph,
|
147 |
-
createChart("ec_chart", data.ec,
|
148 |
-
createChart("ts_chart", data.tS,
|
149 |
-
createChart("ta_chart", data.tA,
|
150 |
-
createChart("hdm_chart", data.hDm,
|
151 |
-
createChart("sven_chart", data.sVen,
|
152 |
Plotly.newPlot("pump_chart", [
|
153 |
{
|
154 |
x: data.dates,
|
@@ -157,7 +157,7 @@ body {
|
|
157 |
mode: "lines+markers",
|
158 |
line: { color: "green" },
|
159 |
hovertemplate: data.days_of_week.map((day, index) =>
|
160 |
-
|
161 |
)
|
162 |
},
|
163 |
{
|
@@ -167,7 +167,7 @@ body {
|
|
167 |
mode: "lines+markers",
|
168 |
line: { color: "brown" },
|
169 |
hovertemplate: data.days_of_week.map((day, index) =>
|
170 |
-
|
171 |
)
|
172 |
},
|
173 |
{
|
@@ -177,11 +177,11 @@ body {
|
|
177 |
mode: "lines+markers",
|
178 |
line: { color: "orange" },
|
179 |
hovertemplate: data.days_of_week.map((day, index) =>
|
180 |
-
|
181 |
)
|
182 |
}
|
183 |
], {
|
184 |
-
title:
|
185 |
xaxis: { title: "", showticklabels: false },
|
186 |
yaxis: { title: "Время ВКЛ(сек.)" },
|
187 |
hovermode: "closest",
|
@@ -199,42 +199,32 @@ body {
|
|
199 |
function navigateWeek(change) {
|
200 |
const newWeek = weekNumber + change;
|
201 |
if (newWeek >= 1 && newWeek <= 30) {
|
202 |
-
window.location.href =
|
203 |
}
|
204 |
}
|
205 |
</script>
|
206 |
|
207 |
-
|
208 |
-
|
209 |
<script>
|
210 |
document.getElementById("st_onl").addEventListener("click", function() {
|
211 |
-
// Получаем основной URL без пути и параметров
|
212 |
var baseUrl = window.location.origin;
|
213 |
-
// Добавляем необходимый путь к основному URL
|
214 |
var targetUrl = baseUrl + "/online";
|
215 |
-
// Переходим по сформированному URL
|
216 |
window.location.href = targetUrl;
|
217 |
});
|
218 |
</script>
|
219 |
<script>
|
220 |
document.getElementById("st_set").addEventListener("click", function() {
|
221 |
-
// Получаем основной URL без пути и параметров
|
222 |
var baseUrl = window.location.origin;
|
223 |
-
// Добавляем необходимый путь к основному URL
|
224 |
var targetUrl = baseUrl + "/settings";
|
225 |
-
// Переходим по сформированному URL
|
226 |
window.location.href = targetUrl;
|
227 |
});
|
228 |
</script>
|
229 |
<script>
|
230 |
document.getElementById("st_plot").addEventListener("click", function() {
|
231 |
-
// Получаем основной URL без пути и параметров
|
232 |
var baseUrl = window.location.origin;
|
233 |
-
// Добавляем необходимый путь к основному URL
|
234 |
var targetUrl = baseUrl + "/plot_week";
|
235 |
-
// Переходим по сформированному URL
|
236 |
window.location.href = targetUrl;
|
237 |
});
|
238 |
</script>
|
239 |
</body>
|
|
|
240 |
</html>
|
|
|
133 |
mode: "lines+markers",
|
134 |
line: { color: color },
|
135 |
hovertemplate: data.days_of_week.map((day, index) =>
|
136 |
+
`Неделя: ${data.week}<br>День: ${day}<br>Время системы: ${data.sus[index]}<br>Насос A: %{y} сек.<br>Дата: ${data.dates[index]}`
|
137 |
)
|
138 |
}], {
|
139 |
title: title,
|
|
|
143 |
showlegend: false
|
144 |
});
|
145 |
}
|
146 |
+
createChart("ph_chart", data.ph, `График pH за ${data.week}-ю неделю`, "Уровень pH", "blue");
|
147 |
+
createChart("ec_chart", data.ec, `График EC за ${data.week}-ю неделю`, "Уровень EC", "blue");
|
148 |
+
createChart("ts_chart", data.tS, `Температура раствора за ${data.week}-ю неделю`, "Температура (°C)", "purple");
|
149 |
+
createChart("ta_chart", data.tA, `Температура воздуха за ${data.week}-ю неделю`, "Температура (°C)", "purple");
|
150 |
+
createChart("hdm_chart", data.hDm, `Влажность воздуха за ${data.week}-ю неделю`, "Влажность (%)", "purple");
|
151 |
+
createChart("sven_chart", data.sVen, `Обороты вентилятора за ${data.week}-ю неделю`, "Обороты (%)", "purple");
|
152 |
Plotly.newPlot("pump_chart", [
|
153 |
{
|
154 |
x: data.dates,
|
|
|
157 |
mode: "lines+markers",
|
158 |
line: { color: "green" },
|
159 |
hovertemplate: data.days_of_week.map((day, index) =>
|
160 |
+
`Неделя: ${data.week}<br>День: ${day}<br>Время системы: ${data.sus[index]}<br>Насос A: %{y} сек.<br>Дата: ${data.dates[index]}`
|
161 |
)
|
162 |
},
|
163 |
{
|
|
|
167 |
mode: "lines+markers",
|
168 |
line: { color: "brown" },
|
169 |
hovertemplate: data.days_of_week.map((day, index) =>
|
170 |
+
`День: ${day}<br>Насос B: %{y} сек.<br>Дата: ${data.dates[index]}`
|
171 |
)
|
172 |
},
|
173 |
{
|
|
|
177 |
mode: "lines+markers",
|
178 |
line: { color: "orange" },
|
179 |
hovertemplate: data.days_of_week.map((day, index) =>
|
180 |
+
`День: ${day}<br>Насос C: %{y} сек.<br>Дата: ${data.dates[index]}`
|
181 |
)
|
182 |
}
|
183 |
], {
|
184 |
+
title: `Интервал дозирования насосов для ${data.week}-ой недели`,
|
185 |
xaxis: { title: "", showticklabels: false },
|
186 |
yaxis: { title: "Время ВКЛ(сек.)" },
|
187 |
hovermode: "closest",
|
|
|
199 |
function navigateWeek(change) {
|
200 |
const newWeek = weekNumber + change;
|
201 |
if (newWeek >= 1 && newWeek <= 30) {
|
202 |
+
window.location.href = `/plot_week?week=${newWeek}`;
|
203 |
}
|
204 |
}
|
205 |
</script>
|
206 |
|
|
|
|
|
207 |
<script>
|
208 |
document.getElementById("st_onl").addEventListener("click", function() {
|
|
|
209 |
var baseUrl = window.location.origin;
|
|
|
210 |
var targetUrl = baseUrl + "/online";
|
|
|
211 |
window.location.href = targetUrl;
|
212 |
});
|
213 |
</script>
|
214 |
<script>
|
215 |
document.getElementById("st_set").addEventListener("click", function() {
|
|
|
216 |
var baseUrl = window.location.origin;
|
|
|
217 |
var targetUrl = baseUrl + "/settings";
|
|
|
218 |
window.location.href = targetUrl;
|
219 |
});
|
220 |
</script>
|
221 |
<script>
|
222 |
document.getElementById("st_plot").addEventListener("click", function() {
|
|
|
223 |
var baseUrl = window.location.origin;
|
|
|
224 |
var targetUrl = baseUrl + "/plot_week";
|
|
|
225 |
window.location.href = targetUrl;
|
226 |
});
|
227 |
</script>
|
228 |
</body>
|
229 |
+
|
230 |
</html>
|