var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1766530839000,3.30000000],[1766530967000,3.30000000],[1766531287000,3.30000000],[1766531607000,3.30000000],[1766531863000,3.30000000],[1766532183000,3.30000000],[1766532503000,3.30000000],[1766532759000,3.30000000],[1766533079000,3.30000000],[1766533399000,3.30000000],[1766533653000,3.30000000],[1766533975000,3.30000000],[1766534295000,3.30000000],[1766534551000,3.30000000],[1766534871000,3.30000000],[1766535191000,3.30000000],[1766535511000,3.30000000],[1766535767000,3.30000000],[1766536087000,3.30000000],[1766536407000,3.30000000],[1766536663000,3.30000000],[1766536983000,3.30000000],[1766537303000,3.30000000],[1766537559000,3.30000000],[1766537879000,3.30000000],[1766538199000,3.22500000],[1766538453000,3.20000000],[1766538775000,3.20000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1766530839000,3.2],[1766530967000,3.2],[1766531287000,3.2],[1766531607000,3.2],[1766531863000,3.2],[1766532183000,3.2],[1766532503000,3.2],[1766532759000,3.2],[1766533079000,3.2],[1766533399000,3.2],[1766533653000,3.2],[1766533975000,3.2],[1766534295000,3.2],[1766534551000,3.2],[1766534871000,3.2],[1766535191000,3.2],[1766535511000,3.2],[1766535767000,3.2],[1766536087000,3.2],[1766536407000,3.2],[1766536663000,3.2],[1766536983000,3.2],[1766537303000,3.2],[1766537559000,3.2],[1766537879000,3.2],[1766538199000,3.1],[1766538453000,3.1],[1766538775000,3.1],], 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: [[1766530839000,99.00000000],[1766530967000,99.00000000],[1766531287000,99.00000000],[1766531607000,99.00000000],[1766531863000,99.00000000],[1766532183000,99.00000000],[1766532503000,99.00000000],[1766532759000,99.00000000],[1766533079000,99.00000000],[1766533399000,99.00000000],[1766533653000,99.00000000],[1766533975000,99.00000000],[1766534295000,99.00000000],[1766534551000,99.00000000],[1766534871000,99.00000000],[1766535191000,99.00000000],[1766535511000,99.00000000],[1766535767000,99.00000000],[1766536087000,99.00000000],[1766536407000,99.00000000],[1766536663000,99.00000000],[1766536983000,99.00000000],[1766537303000,99.00000000],[1766537559000,99.00000000],[1766537879000,99.00000000],[1766538199000,99.00000000],[1766538453000,99.00000000],[1766538775000,99.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: [[1766530839000,1022],[1766530967000,1022],[1766531287000,1022.1],[1766531607000,1022],[1766531863000,1022],[1766532183000,1022],[1766532503000,1022],[1766532759000,1022],[1766533079000,1022],[1766533399000,1021.9],[1766533653000,1022.1],[1766533975000,1022],[1766534295000,1022],[1766534551000,1022.1],[1766534871000,1022.1],[1766535191000,1022.1],[1766535511000,1022.1],[1766535767000,1022.1],[1766536087000,1022.1],[1766536407000,1022],[1766536663000,1022],[1766536983000,1022.1],[1766537303000,1022],[1766537559000,1022],[1766537879000,1022.1],[1766538199000,1022.1],[1766538453000,1022.2],[1766538775000,1022.1],], 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: [[1766530839000,0],[1766530967000,0],[1766531287000,0],[1766531607000,0],[1766531863000,0],[1766532183000,0],[1766532503000,0],[1766532759000,0],[1766533079000,0],[1766533399000,0],[1766533653000,0],[1766533975000,0],[1766534295000,0.09],[1766534551000,0.072],[1766534871000,0.144],[1766535191000,0],[1766535511000,0],[1766535767000,0],[1766536087000,0],[1766536407000,0],[1766536663000,0],[1766536983000,0],[1766537303000,0],[1766537559000,0],[1766537879000,0],[1766538199000,0],[1766538453000,0],[1766538775000,0],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1766530839000,0],[1766530967000,0],[1766531287000,0],[1766531607000,0],[1766531863000,0],[1766532183000,0],[1766532503000,0],[1766532759000,0],[1766533079000,0],[1766533399000,0],[1766533653000,0],[1766533975000,0],[1766534295000,0.63],[1766534551000,0.504],[1766534871000,1.008],[1766535191000,0],[1766535511000,0],[1766535767000,0],[1766536087000,0],[1766536407000,0],[1766536663000,0],[1766536983000,0],[1766537303000,0],[1766537559000,0],[1766537879000,0],[1766538199000,0],[1766538453000,0],[1766538775000,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: [[1766530839000,210.00000000],[1766530967000,210.00000000],[1766531287000,210.00000000],[1766531607000,210.00000000],[1766531863000,210.00000000],[1766532183000,210.00000000],[1766532503000,211.50000000],[1766532759000,212.80000000],[1766533079000,212.80000000],[1766533399000,212.00000000],[1766533653000,212.00000000],[1766533975000,212.00000000],[1766534295000,210.00000000],[1766534551000,206.80000000],[1766534871000,202.00000000],[1766535191000,202.00000000],[1766535511000,200.75000000],[1766535767000,200.00000000],[1766536087000,203.20000000],[1766536407000,208.00000000],[1766536663000,208.00000000],[1766536983000,208.00000000],[1766537303000,208.00000000],[1766537559000,208.00000000],[1766537879000,208.00000000],[1766538199000,208.00000000],[1766538453000,208.00000000],[1766538775000,208.00000000],], 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: [[1766530839000,0.00000000],[1766530967000,0.00000000],[1766531287000,0.00000000],[1766531607000,0.00000000],[1766531863000,0.00000000],[1766532183000,0.00000000],[1766532503000,0.00000000],[1766532759000,0.00000000],[1766533079000,0.00000000],[1766533399000,0.00000000],[1766533653000,0.00000000],[1766533975000,0.00000000],[1766534295000,0.00000000],[1766534551000,0.00000000],[1766534871000,0.00000000],[1766535191000,0.00000000],[1766535511000,0.00000000],[1766535767000,0.00000000],[1766536087000,0.00000000],[1766536407000,0.00000000],[1766536663000,0.00000000],[1766536983000,0.00000000],[1766537303000,0.00000000],[1766537559000,0.00000000],[1766537879000,0.00000000],[1766538199000,0.00000000],[1766538453000,0.00000000],[1766538775000,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: [[1766530839000,0.00000000],[1766530967000,0.00000000],[1766531287000,0.00000000],[1766531607000,0.00000000],[1766531863000,0.00000000],[1766532183000,0.00000000],[1766532503000,0.00000000],[1766532759000,0.00000000],[1766533079000,0.00000000],[1766533399000,0.00000000],[1766533653000,0.00000000],[1766533975000,0.00000000],[1766534295000,0.00000000],[1766534551000,0.00000000],[1766534871000,0.00000000],[1766535191000,0.00000000],[1766535511000,0.00000000],[1766535767000,0.00000000],[1766536087000,0.00000000],[1766536407000,0.00000000],[1766536663000,0.00000000],[1766536983000,0.00000000],[1766537303000,0.00000000],[1766537559000,0.00000000],[1766537879000,0.00000000],[1766538199000,0.00000000],[1766538453000,0.00000000],[1766538775000,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: [[1766530839000,0.00000000],[1766530967000,0.00000000],[1766531287000,0.00000000],[1766531607000,0.00000000],[1766531863000,0.00000000],[1766532183000,0.00000000],[1766532503000,0.10150000],[1766532759000,0.20300000],[1766533079000,0.20300000],[1766533399000,0.20300000],[1766533653000,0.20300000],[1766533975000,0.20300000],[1766534295000,0.20300000],[1766534551000,0.20300000],[1766534871000,0.20300000],[1766535191000,0.20300000],[1766535511000,0.20300000],[1766535767000,0.20300000],[1766536087000,0.20300000],[1766536407000,0.20300000],[1766536663000,0.20300000],[1766536983000,0.20300000],[1766537303000,0.20300000],[1766537559000,0.26400000],[1766537879000,0.50800000],[1766538199000,0.50800000],[1766538453000,0.50800000],[1766538775000,0.50800000],], 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; }