var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1767913206000,-4.07500000],[1767913381000,-4.11428571],[1767913654000,-4.21250000],[1767914005000,-4.30000000],[1767914277000,-4.42857143],[1767914550000,-4.50000000],[1767914853000,-4.62500000],[1767915205000,-4.71428571],[1767915477000,-4.73750000],[1767915781000,-4.70000000],[1767916053000,-4.70000000],[1767916406000,-4.78571429],[1767916677000,-4.80000000],[1767916982000,-4.86666667],[1767917253000,-5.03750000],[1767917605000,-5.21428571],[1767917878000,-5.58750000],[1767918181000,-5.60000000],[1767918453000,-5.65000000],[1767918774000,-5.86250000],[1767919077000,-5.86250000],[1767919350000,-5.72500000],[1767919652000,-5.70000000],[1767919973000,-5.82500000],[1767920277000,-5.90000000],[1767920581000,-5.90000000],[1767920901000,-5.80000000],[1767921173000,-5.86250000],[1767921477000,-5.93333333],[1767921782000,-6.30000000],[1767922052000,-6.35555556],[1767922405000,-6.20000000],[1767922678000,-6.20000000],[1767922981000,-6.25000000],[1767923253000,-6.28750000],[1767923574000,-6.30000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1767913206000,-7.9],[1767913381000,-7.8],[1767913654000,-7.9],[1767914005000,-7.8],[1767914277000,-7.9],[1767914550000,-8],[1767914853000,-8.1],[1767915205000,-8.2],[1767915477000,-8.2],[1767915781000,-8.2],[1767916053000,-8.2],[1767916406000,-8.1],[1767916677000,-8.1],[1767916982000,-8.2],[1767917253000,-8.3],[1767917605000,-8.3],[1767917878000,-8.5],[1767918181000,-8.4],[1767918453000,-8.4],[1767918774000,-8.6],[1767919077000,-8.6],[1767919350000,-8.5],[1767919652000,-8.5],[1767919973000,-8.6],[1767920277000,-8.5],[1767920581000,-8.5],[1767920901000,-8.4],[1767921173000,-8.5],[1767921477000,-8.5],[1767921782000,-8.8],[1767922052000,-8.8],[1767922405000,-8.5],[1767922678000,-8.5],[1767922981000,-8.5],[1767923253000,-8.7],[1767923574000,-8.7],], color: '#5b9f4a' } ]; var options = { xaxes: [{ axisLabel: 'temperature', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.1°C' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-temperature-legend' } }; graphs['#chart-temperature'] = $.plot('#chart-temperature', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Vlhkosť (%)', data: [[1767913206000,75.00000000],[1767913381000,75.71428571],[1767913654000,76.00000000],[1767914005000,76.85714286],[1767914277000,77.00000000],[1767914550000,77.00000000],[1767914853000,77.00000000],[1767915205000,77.00000000],[1767915477000,77.00000000],[1767915781000,77.00000000],[1767916053000,77.00000000],[1767916406000,77.85714286],[1767916677000,78.00000000],[1767916982000,78.00000000],[1767917253000,78.12500000],[1767917605000,79.00000000],[1767917878000,80.37500000],[1767918181000,81.00000000],[1767918453000,81.00000000],[1767918774000,81.00000000],[1767919077000,81.37500000],[1767919350000,81.00000000],[1767919652000,81.00000000],[1767919973000,81.12500000],[1767920277000,82.00000000],[1767920581000,82.00000000],[1767920901000,82.00000000],[1767921173000,82.00000000],[1767921477000,82.00000000],[1767921782000,82.85714286],[1767922052000,83.00000000],[1767922405000,84.00000000],[1767922678000,84.00000000],[1767922981000,84.00000000],[1767923253000,83.25000000],[1767923574000,83.00000000],], color: '#ff9000' } ]; var options = { xaxes: [{ axisLabel: 'humidity', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.1%' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-humidity-legend' } }; graphs['#chart-humidity'] = $.plot('#chart-humidity', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Atmosférický tlak (hPa)', data: [[1767913206000,1012.5],[1767913381000,1012.4],[1767913654000,1012.4],[1767914005000,1012.3],[1767914277000,1012.1],[1767914550000,1012.2],[1767914853000,1012.1],[1767915205000,1012.2],[1767915477000,1012.1],[1767915781000,1012],[1767916053000,1012.1],[1767916406000,1011.9],[1767916677000,1011.9],[1767916982000,1011.9],[1767917253000,1011.9],[1767917605000,1011.9],[1767917878000,1012],[1767918181000,1012],[1767918453000,1011.9],[1767918774000,1012],[1767919077000,1011.9],[1767919350000,1012],[1767919652000,1012.1],[1767919973000,1012.2],[1767920277000,1012.2],[1767920581000,1012.2],[1767920901000,1012],[1767921173000,1012.1],[1767921477000,1012.1],[1767921782000,1012.2],[1767922052000,1012.1],[1767922405000,1012],[1767922678000,1012],[1767922981000,1012],[1767923253000,1011.7],[1767923574000,1011.7],], color: '#000000' } ]; var options = { xaxes: [{ axisLabel: 'pressure', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.1hPa' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-pressure-legend' } }; graphs['#chart-pressure'] = $.plot('#chart-pressure', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Rýchlosť vetra (km/h)', data: [[1767913206000,0.54],[1767913381000,0],[1767913654000,0.315],[1767914005000,2.005714296],[1767914277000,1.748571444],[1767914550000,2.25],[1767914853000,3.15],[1767915205000,1.337142852],[1767915477000,0],[1767915781000,1.748571444],[1767916053000,0.9],[1767916406000,3.188571444],[1767916677000,3.69],[1767916982000,0.479999988],[1767917253000,0],[1767917605000,0],[1767917878000,0],[1767918181000,0],[1767918453000,0],[1767918774000,0],[1767919077000,0],[1767919350000,1.485],[1767919652000,3.51],[1767919973000,2.925],[1767920277000,3.96],[1767920581000,3.555],[1767920901000,3.651428556],[1767921173000,0.315],[1767921477000,0],[1767921782000,0],[1767922052000,0],[1767922405000,0],[1767922678000,0],[1767922981000,0],[1767923253000,0],[1767923574000,0],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1767913206000,0.63],[1767913381000,0],[1767913654000,0.315],[1767914005000,3.6],[1767914277000,2.52],[1767914550000,3.15],[1767914853000,4.725],[1767915205000,2.52],[1767915477000,0],[1767915781000,2.52],[1767916053000,2.205],[1767916406000,3.96],[1767916677000,4.725],[1767916982000,0.839999988],[1767917253000,0],[1767917605000,0],[1767917878000,0],[1767918181000,0],[1767918453000,0],[1767918774000,0],[1767919077000,0],[1767919350000,2.205],[1767919652000,4.41],[1767919973000,3.78],[1767920277000,5.67],[1767920581000,4.41],[1767920901000,5.04],[1767921173000,0.315],[1767921477000,0],[1767921782000,0],[1767922052000,0],[1767922405000,0],[1767922678000,0],[1767922981000,0],[1767923253000,0],[1767923574000,0],], color: '#EF9856', points: { show: true }, lines: { show: false }, } ]; var options = { xaxes: [{ axisLabel: 'wind', }], xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.1km/h' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-wind-legend' } }; graphs['#chart-wind'] = $.plot('#chart-wind', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Smer vetra', data: [[1767913206000,137.25000000],[1767913381000,124.28571429],[1767913654000,129.75000000],[1767914005000,118.85714286],[1767914277000,128.14285714],[1767914550000,120.50000000],[1767914853000,117.00000000],[1767915205000,134.42857143],[1767915477000,129.87500000],[1767915781000,121.85714286],[1767916053000,124.37500000],[1767916406000,99.71428571],[1767916677000,97.87500000],[1767916982000,135.50000000],[1767917253000,150.87500000],[1767917605000,182.85714286],[1767917878000,193.62500000],[1767918181000,187.28571429],[1767918453000,170.25000000],[1767918774000,169.00000000],[1767919077000,174.25000000],[1767919350000,198.37500000],[1767919652000,206.62500000],[1767919973000,180.00000000],[1767920277000,179.62500000],[1767920581000,185.37500000],[1767920901000,187.85714286],[1767921173000,174.37500000],[1767921477000,180.55555556],[1767921782000,187.14285714],[1767922052000,184.44444444],[1767922405000,171.87500000],[1767922678000,173.75000000],[1767922981000,169.12500000],[1767923253000,153.00000000],[1767923574000,158.60000000],], color: '#002f80', points: { show: true }, lines: { show: false }, } ]; var options = { xaxes: [{ axisLabel: 'wind_direction', }], xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, yaxis: { min: 0, max: 360, ticks: [[0, 'S'], [90, 'V'], [180, 'J'], [270, 'Z'], [360, 'S']] }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: function(label, xval, yval, flotItem) { dir = meteo_wind_direction_name(yval); format_date = moment(xval).format('DD.MM., hh:mm') return format_date+' - '+dir; } }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-wind-direction-legend' } }; graphs['#chart-wind-direction'] = $.plot('#chart-wind-direction', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Slnečné žiarenie (W/m2)', data: [[1767913206000,0.00000000],[1767913381000,0.00000000],[1767913654000,0.00000000],[1767914005000,0.00000000],[1767914277000,0.00000000],[1767914550000,0.00000000],[1767914853000,0.00000000],[1767915205000,0.00000000],[1767915477000,0.00000000],[1767915781000,0.00000000],[1767916053000,0.00000000],[1767916406000,0.00000000],[1767916677000,0.00000000],[1767916982000,0.00000000],[1767917253000,0.00000000],[1767917605000,0.00000000],[1767917878000,0.00000000],[1767918181000,0.00000000],[1767918453000,0.00000000],[1767918774000,0.00000000],[1767919077000,0.00000000],[1767919350000,0.00000000],[1767919652000,0.00000000],[1767919973000,0.00000000],[1767920277000,0.00000000],[1767920581000,0.00000000],[1767920901000,0.00000000],[1767921173000,0.00000000],[1767921477000,0.00000000],[1767921782000,0.00000000],[1767922052000,0.00000000],[1767922405000,0.00000000],[1767922678000,0.00000000],[1767922981000,0.00000000],[1767923253000,0.00000000],[1767923574000,0.00000000],], color: '#ffb92f' } ]; var options = { xaxes: [{ axisLabel: 'solar_radiation', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, yaxis: { min: 0, }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.1W/m2' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-solar-radiation-legend' } }; graphs['#chart-solar-radiation'] = $.plot('#chart-solar-radiation', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'UV žiarenie', data: [[1767913206000,0.00000000],[1767913381000,0.00000000],[1767913654000,0.00000000],[1767914005000,0.00000000],[1767914277000,0.00000000],[1767914550000,0.00000000],[1767914853000,0.00000000],[1767915205000,0.00000000],[1767915477000,0.00000000],[1767915781000,0.00000000],[1767916053000,0.00000000],[1767916406000,0.00000000],[1767916677000,0.00000000],[1767916982000,0.00000000],[1767917253000,0.00000000],[1767917605000,0.00000000],[1767917878000,0.00000000],[1767918181000,0.00000000],[1767918453000,0.00000000],[1767918774000,0.00000000],[1767919077000,0.00000000],[1767919350000,0.00000000],[1767919652000,0.00000000],[1767919973000,0.00000000],[1767920277000,0.00000000],[1767920581000,0.00000000],[1767920901000,0.00000000],[1767921173000,0.00000000],[1767921477000,0.00000000],[1767921782000,0.00000000],[1767922052000,0.00000000],[1767922405000,0.00000000],[1767922678000,0.00000000],[1767922981000,0.00000000],[1767923253000,0.00000000],[1767923574000,0.00000000],], color: '#802674' } ]; var options = { xaxes: [{ axisLabel: 'uv', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, yaxis: { min: 0, }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.0' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-uv-legend' } }; graphs['#chart-uv'] = $.plot('#chart-uv', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Zrážky', data: [[1767913206000,0.00000000],[1767913381000,0.00000000],[1767913654000,0.00000000],[1767914005000,0.00000000],[1767914277000,0.00000000],[1767914550000,0.00000000],[1767914853000,0.00000000],[1767915205000,0.00000000],[1767915477000,0.00000000],[1767915781000,0.00000000],[1767916053000,0.00000000],[1767916406000,0.00000000],[1767916677000,0.00000000],[1767916982000,0.00000000],[1767917253000,0.00000000],[1767917605000,0.00000000],[1767917878000,0.00000000],[1767918181000,0.00000000],[1767918453000,0.00000000],[1767918774000,0.00000000],[1767919077000,0.00000000],[1767919350000,0.00000000],[1767919652000,0.00000000],[1767919973000,0.00000000],[1767920277000,0.00000000],[1767920581000,0.00000000],[1767920901000,0.00000000],[1767921173000,0.00000000],[1767921477000,0.00000000],[1767921782000,0.00000000],[1767922052000,0.00000000],[1767922405000,0.00000000],[1767922678000,0.00000000],[1767922981000,0.00000000],[1767923253000,0.00000000],[1767923574000,0.00000000],], color: '#008fbf' } ]; var options = { xaxes: [{ axisLabel: 'rain', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, yaxis: { min: 0, }, xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: '%x - %y.3mm' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-rain-legend' } }; graphs['#chart-rain'] = $.plot('#chart-rain', dataset, options); }); $('.modal').on('hide.bs.modal', function() { var memory = $(this).html(); $(this).html(memory); }); function meteo_wind_direction_name(wind_direction) { if (wind_direction >= 0.00 && wind_direction <= 11.25) { ret = 'S'; } else if (wind_direction > 11.25 && wind_direction <= 33.75) { ret = 'SSV'; } else if (wind_direction > 33.75 && wind_direction <= 56.25) { ret = 'SV'; } else if (wind_direction > 56.25 && wind_direction <= 78.75) { // 67.5 ret = 'VSV'; } else if (wind_direction > 78.75 && wind_direction <= 101.25) { // 90 ret = 'V'; } else if (wind_direction > 101.25 && wind_direction <= 123.75) { //112.5 ret = 'VJV'; } else if (wind_direction > 123.75 && wind_direction <= 146.25) { // 135 ret = 'JV'; } else if (wind_direction > 146.25 && wind_direction <= 168.75) { // 157.5 ret = 'JJV'; } else if (wind_direction > 168.75 && wind_direction <= 191.25) { // 180 ret = 'J'; } else if (wind_direction > 191.25 && wind_direction <= 213.75) { // 202.5 ret = 'JJZ'; } else if (wind_direction > 213.75 && wind_direction <= 236.25) { // 225 ret = 'JZ'; } else if (wind_direction > 236.25 && wind_direction <= 258.75) { // 247.5 ret = 'ZJZ'; } else if (wind_direction > 258.75 && wind_direction <= 281.25) { // 270 ret = 'Z'; } else if (wind_direction > 281.25 && wind_direction <= 303.75) { // 292.5 ret = 'ZSZ'; } else if (wind_direction > 303.75 && wind_direction <= 326.25) { // 315 ret = 'SZ'; } else if (wind_direction > 326.25 && wind_direction <= 348.75) { // 337.5 ret = 'SSZ'; } else if (wind_direction > 348.75 && wind_direction <= 360.0) { // 337.5 ret = 'S'; } else { return ''; } return ret; }