var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1775426430000,14.20000000],[1775426556000,14.20000000],[1775426877000,14.28000000],[1775427197000,14.22500000],[1775427451000,14.36000000],[1775427773000,14.26000000],[1775428093000,14.28000000],[1775428412000,14.12500000],[1775428668000,13.86000000],[1775428988000,13.52000000],[1775429308000,13.75000000],[1775429564000,13.82000000],[1775429884000,13.66000000],[1775430204000,13.50000000],[1775430461000,13.34000000],[1775430780000,13.14000000],[1775431100000,13.20000000],[1775431356000,13.18000000],[1775431676000,13.38000000],[1775431996000,13.37500000],[1775432253000,13.00000000],[1775432572000,12.62000000],[1775432892000,12.50000000],[1775433212000,12.50000000],[1775433468000,12.50000000],[1775433789000,12.46000000],[1775434110000,12.40000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1775426430000,8.3],[1775426556000,8.3],[1775426877000,8.6],[1775427197000,8.4],[1775427451000,8.4],[1775427773000,8.4],[1775428093000,8.3],[1775428412000,8.3],[1775428668000,8.1],[1775428988000,8],[1775429308000,8],[1775429564000,7.8],[1775429884000,7.8],[1775430204000,7.9],[1775430461000,7.8],[1775430780000,7.7],[1775431100000,7.8],[1775431356000,7.7],[1775431676000,7.8],[1775431996000,7.8],[1775432253000,7.7],[1775432572000,7.7],[1775432892000,7.6],[1775433212000,7.5],[1775433468000,7.5],[1775433789000,7.7],[1775434110000,7.6],], 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: [[1775426430000,68.00000000],[1775426556000,68.00000000],[1775426877000,69.00000000],[1775427197000,68.25000000],[1775427451000,67.80000000],[1775427773000,68.00000000],[1775428093000,67.40000000],[1775428412000,68.00000000],[1775428668000,68.60000000],[1775428988000,69.40000000],[1775429308000,68.25000000],[1775429564000,67.40000000],[1775429884000,68.00000000],[1775430204000,69.00000000],[1775430461000,69.20000000],[1775430780000,69.80000000],[1775431100000,70.00000000],[1775431356000,69.60000000],[1775431676000,69.00000000],[1775431996000,69.25000000],[1775432253000,70.60000000],[1775432572000,72.40000000],[1775432892000,72.20000000],[1775433212000,72.00000000],[1775433468000,72.00000000],[1775433789000,72.80000000],[1775434110000,73.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: [[1775426430000,1023.1],[1775426556000,1023.2],[1775426877000,1023.4],[1775427197000,1023.3],[1775427451000,1023],[1775427773000,1022.9],[1775428093000,1022.9],[1775428412000,1023],[1775428668000,1023.2],[1775428988000,1023.3],[1775429308000,1023.4],[1775429564000,1023.3],[1775429884000,1023.2],[1775430204000,1023.2],[1775430461000,1023.2],[1775430780000,1023.1],[1775431100000,1023],[1775431356000,1023],[1775431676000,1022.9],[1775431996000,1022.9],[1775432253000,1023],[1775432572000,1023.1],[1775432892000,1022.9],[1775433212000,1022.9],[1775433468000,1022.7],[1775433789000,1022.7],[1775434110000,1022.8],], 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: [[1775426430000,2.88],[1775426556000,3.312],[1775426877000,2.952],[1775427197000,3.42],[1775427451000,2.592],[1775427773000,2.088],[1775428093000,2.16],[1775428412000,2.07],[1775428668000,0.144],[1775428988000,2.304],[1775429308000,2.07],[1775429564000,1.296],[1775429884000,1.656],[1775430204000,2.43],[1775430461000,1.296],[1775430780000,2.808],[1775431100000,2.07],[1775431356000,2.736],[1775431676000,2.16],[1775431996000,0.9],[1775432253000,1.656],[1775432572000,1.872],[1775432892000,2.088],[1775433212000,2.52],[1775433468000,1.944],[1775433789000,2.304],[1775434110000,2.34],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1775426430000,3.78],[1775426556000,4.536],[1775426877000,5.04],[1775427197000,4.41],[1775427451000,4.032],[1775427773000,3.024],[1775428093000,2.52],[1775428412000,3.78],[1775428668000,1.008],[1775428988000,3.024],[1775429308000,3.15],[1775429564000,2.016],[1775429884000,2.52],[1775430204000,2.52],[1775430461000,2.016],[1775430780000,3.528],[1775431100000,2.52],[1775431356000,3.024],[1775431676000,3.024],[1775431996000,2.52],[1775432253000,3.024],[1775432572000,2.52],[1775432892000,2.52],[1775433212000,2.52],[1775433468000,3.528],[1775433789000,3.528],[1775434110000,2.52],], 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: [[1775426430000,166.50000000],[1775426556000,201.80000000],[1775426877000,194.00000000],[1775427197000,202.75000000],[1775427451000,186.40000000],[1775427773000,186.20000000],[1775428093000,204.00000000],[1775428412000,193.50000000],[1775428668000,165.40000000],[1775428988000,86.60000000],[1775429308000,12.25000000],[1775429564000,217.80000000],[1775429884000,359.00000000],[1775430204000,358.75000000],[1775430461000,358.60000000],[1775430780000,358.20000000],[1775431100000,357.25000000],[1775431356000,356.60000000],[1775431676000,356.00000000],[1775431996000,356.00000000],[1775432253000,354.40000000],[1775432572000,305.20000000],[1775432892000,315.00000000],[1775433212000,315.25000000],[1775433468000,315.60000000],[1775433789000,336.60000000],[1775434110000,335.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: [[1775426430000,0.00000000],[1775426556000,0.00000000],[1775426877000,0.00000000],[1775427197000,0.00000000],[1775427451000,0.00000000],[1775427773000,0.00000000],[1775428093000,0.00000000],[1775428412000,0.00000000],[1775428668000,0.00000000],[1775428988000,0.00000000],[1775429308000,0.00000000],[1775429564000,0.00000000],[1775429884000,0.00000000],[1775430204000,0.00000000],[1775430461000,0.00000000],[1775430780000,0.00000000],[1775431100000,0.00000000],[1775431356000,0.00000000],[1775431676000,0.00000000],[1775431996000,0.00000000],[1775432253000,0.00000000],[1775432572000,0.00000000],[1775432892000,0.00000000],[1775433212000,0.00000000],[1775433468000,0.00000000],[1775433789000,0.00000000],[1775434110000,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: [[1775426430000,0.00000000],[1775426556000,0.00000000],[1775426877000,0.00000000],[1775427197000,0.00000000],[1775427451000,0.00000000],[1775427773000,0.00000000],[1775428093000,0.00000000],[1775428412000,0.00000000],[1775428668000,0.00000000],[1775428988000,0.00000000],[1775429308000,0.00000000],[1775429564000,0.00000000],[1775429884000,0.00000000],[1775430204000,0.00000000],[1775430461000,0.00000000],[1775430780000,0.00000000],[1775431100000,0.00000000],[1775431356000,0.00000000],[1775431676000,0.00000000],[1775431996000,0.00000000],[1775432253000,0.00000000],[1775432572000,0.00000000],[1775432892000,0.00000000],[1775433212000,0.00000000],[1775433468000,0.00000000],[1775433789000,0.00000000],[1775434110000,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: [[1775426430000,0.00000000],[1775426556000,0.00000000],[1775426877000,0.00000000],[1775427197000,0.00000000],[1775427451000,0.00000000],[1775427773000,0.00000000],[1775428093000,0.00000000],[1775428412000,0.00000000],[1775428668000,0.00000000],[1775428988000,0.00000000],[1775429308000,0.00000000],[1775429564000,0.00000000],[1775429884000,0.00000000],[1775430204000,0.00000000],[1775430461000,0.00000000],[1775430780000,0.00000000],[1775431100000,0.00000000],[1775431356000,0.00000000],[1775431676000,0.00000000],[1775431996000,0.00000000],[1775432253000,0.00000000],[1775432572000,0.00000000],[1775432892000,0.00000000],[1775433212000,0.00000000],[1775433468000,0.00000000],[1775433789000,0.00000000],[1775434110000,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; }