Spaces:
Sleeping
Sleeping
Update online.html
Browse files- online.html +29 -33
online.html
CHANGED
|
@@ -649,41 +649,37 @@ document.getElementById("but_sliv").addEventListener("click", function() {
|
|
| 649 |
}
|
| 650 |
|
| 651 |
function updateDataHistory(data) {
|
| 652 |
-
|
| 653 |
-
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
| 661 |
-
|
| 662 |
-
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
| 668 |
-
|
| 669 |
-
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
dataHistory.tA.shift();
|
| 679 |
-
dataHistory.hDm.shift();
|
| 680 |
-
dataHistory.sVen.shift();
|
| 681 |
-
}
|
| 682 |
-
|
| 683 |
-
// Пересчитываем labels как индексы от 0 до maxPoints-1
|
| 684 |
-
dataHistory.labels = Array.from({ length: dataHistory.labels.length }, (_, i) => i);
|
| 685 |
}
|
| 686 |
|
|
|
|
|
|
|
|
|
|
| 687 |
function updateChart() {
|
| 688 |
const customdata = dataHistory.dates.map((date, i) => [date, dataHistory.times[i]]);
|
| 689 |
Plotly.update("parametersChart", {
|
|
|
|
| 649 |
}
|
| 650 |
|
| 651 |
function updateDataHistory(data) {
|
| 652 |
+
dataHistory.labels.push(dataHistory.labels.length);
|
| 653 |
+
dataHistory.dates.push(data.date);
|
| 654 |
+
dataHistory.times.push(data.time);
|
| 655 |
+
dataHistory.ph.push(parseFloat(data.ph));
|
| 656 |
+
dataHistory.ec.push(parseFloat(data.ec));
|
| 657 |
+
dataHistory.ec_A_eep.push(parseFloat(data.ec_A_eep));
|
| 658 |
+
dataHistory.ec_B_eep.push(parseFloat(data.ec_B_eep));
|
| 659 |
+
dataHistory.ec_C_eep.push(parseFloat(data.ec_C_eep)); // Без || 0
|
| 660 |
+
dataHistory.tS.push(parseFloat(data.tS));
|
| 661 |
+
dataHistory.tA.push(parseFloat(data.tA));
|
| 662 |
+
dataHistory.hDm.push(parseFloat(data.hDm));
|
| 663 |
+
dataHistory.sVen.push(parseFloat(data.sVen));
|
| 664 |
+
|
| 665 |
+
while (dataHistory.labels.length > maxPoints) {
|
| 666 |
+
dataHistory.labels.shift();
|
| 667 |
+
dataHistory.dates.shift();
|
| 668 |
+
dataHistory.times.shift();
|
| 669 |
+
dataHistory.ph.shift();
|
| 670 |
+
dataHistory.ec.shift();
|
| 671 |
+
dataHistory.ec_A_eep.shift();
|
| 672 |
+
dataHistory.ec_B_eep.shift();
|
| 673 |
+
dataHistory.ec_C_eep.shift();
|
| 674 |
+
dataHistory.tS.shift();
|
| 675 |
+
dataHistory.tA.shift();
|
| 676 |
+
dataHistory.hDm.shift();
|
| 677 |
+
dataHistory.sVen.shift();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 678 |
}
|
| 679 |
|
| 680 |
+
dataHistory.labels = Array.from({ length: dataHistory.labels.length }, (_, i) => i);
|
| 681 |
+
}
|
| 682 |
+
|
| 683 |
function updateChart() {
|
| 684 |
const customdata = dataHistory.dates.map((date, i) => [date, dataHistory.times[i]]);
|
| 685 |
Plotly.update("parametersChart", {
|