+
📈 Historie teploty
-
- 1 den (24h)
- 2 dny (48h)
- 3 dny (72h)
- 4 dny (96h)
- 5 dní (120h)
-
+
+
+ Osa Y: 0 - 100 °C
+ Osa Y: 10 - 80 °C
+ Osa Y: Auto
+
+
+ 1 den (24h)
+ 2 dny (48h)
+ 3 dny (72h)
+ 4 dny (96h)
+ 5 dní (120h)
+
+
@@ -210,7 +217,7 @@
}
if (currentChartData.data.length > 0) {
- updateChart(currentChartData.data, currentChartData.hours);
+ updateChart(currentChartData.data);
}
}
@@ -221,6 +228,20 @@
applyTheme(currentTheme);
// ---------------------------------------
+ // --- Správa rozsahu osy Y ---
+ const yAxisRangeSelect = document.getElementById('y-axis-range');
+ let currentYAxisRange = localStorage.getItem('graphRange') || '0-100';
+ yAxisRangeSelect.value = currentYAxisRange;
+
+ yAxisRangeSelect.addEventListener('change', (e) => {
+ currentYAxisRange = e.target.value;
+ localStorage.setItem('graphRange', currentYAxisRange);
+ if (currentChartData.data.length > 0) {
+ updateChart(currentChartData.data);
+ }
+ });
+ // ---------------------------------------
+
function showNotification(message, isError = false) {
const notif = document.getElementById('notification');
notif.className = `alert rounded-pill px-4 shadow-lg ${isError ? 'alert-danger' : 'alert-success'}`;
@@ -346,6 +367,17 @@
chartInstance.destroy();
}
+ // Rozhodnutí o min/max pro osu Y na základě vybrané volby
+ let yMin = 0;
+ let yMax = 100;
+ if (currentYAxisRange === '10-80') {
+ yMin = 10;
+ yMax = 80;
+ } else if (currentYAxisRange === 'auto') {
+ yMin = undefined;
+ yMax = undefined;
+ }
+
chartInstance = new Chart(ctx, {
type: 'line',
data: {
@@ -379,8 +411,8 @@
title: { display: true, text: 'Teplota (°C)', color: textColor },
ticks: { color: textColor },
grid: { color: gridColor, drawBorder: false },
- min: 0,
- max: 100
+ min: yMin,
+ max: yMax
}
},
plugins: {