var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1773615610000,-0.96666667],[1773615805000,-1.10000000],[1773616072000,-0.90000000],[1773616392000,-0.64000000],[1773616712000,-0.55000000],[1773616968000,-0.60000000],[1773617288000,-0.02000000],[1773617608000,0.30000000],[1773617864000,0.00000000],[1773618184000,-0.58000000],[1773618504000,-0.77500000],[1773618754000,-0.66000000],[1773619096000,-0.32500000],[1773619352000,-0.30000000],[1773619672000,-0.42000000],[1773619992000,-0.54000000],[1773620314000,-0.77500000],[1773620570000,-0.94000000],[1773620889000,-0.90000000],[1773621210000,-1.30000000],[1773621467000,-1.82000000],[1773621785000,-1.64000000],[1773622105000,-1.12500000],[1773622361000,-0.96000000],[1773622681000,-1.16000000],[1773623001000,-1.27500000],[1773623257000,-1.10000000],[1773623577000,-1.02000000],[1773623898000,-1.22500000],[1773624153000,-1.66000000],[1773624474000,-1.86000000],[1773624793000,-2.60000000],[1773625113000,-2.30000000],[1773625369000,-1.66000000],[1773625690000,-2.08000000],[1773626010000,-2.40000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1773615610000,-1.7],[1773615805000,-1.8],[1773616072000,-1.6],[1773616392000,-1.4],[1773616712000,-1.3],[1773616968000,-1.3],[1773617288000,-0.6],[1773617608000,-0.3],[1773617864000,-0.7],[1773618184000,-1.3],[1773618504000,-1.5],[1773618754000,-1.3],[1773619096000,-0.9],[1773619352000,-0.9],[1773619672000,-1],[1773619992000,-1.1],[1773620314000,-1.3],[1773620570000,-1.5],[1773620889000,-1.5],[1773621210000,-1.9],[1773621467000,-2.4],[1773621785000,-2.2],[1773622105000,-1.6],[1773622361000,-1.5],[1773622681000,-1.7],[1773623001000,-1.8],[1773623257000,-1.5],[1773623577000,-1.5],[1773623898000,-1.8],[1773624153000,-2.2],[1773624474000,-2.4],[1773624793000,-3.2],[1773625113000,-2.8],[1773625369000,-2.1],[1773625690000,-2.6],[1773626010000,-3],], 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: [[1773615610000,95.00000000],[1773615805000,95.00000000],[1773616072000,95.00000000],[1773616392000,95.00000000],[1773616712000,95.00000000],[1773616968000,95.20000000],[1773617288000,96.00000000],[1773617608000,96.00000000],[1773617864000,95.00000000],[1773618184000,95.00000000],[1773618504000,95.00000000],[1773618754000,95.40000000],[1773619096000,96.00000000],[1773619352000,96.00000000],[1773619672000,96.00000000],[1773619992000,96.00000000],[1773620314000,96.00000000],[1773620570000,96.00000000],[1773620889000,96.00000000],[1773621210000,96.00000000],[1773621467000,96.00000000],[1773621785000,96.00000000],[1773622105000,96.50000000],[1773622361000,96.00000000],[1773622681000,96.00000000],[1773623001000,96.50000000],[1773623257000,97.00000000],[1773623577000,96.80000000],[1773623898000,96.00000000],[1773624153000,96.00000000],[1773624474000,96.00000000],[1773624793000,96.00000000],[1773625113000,96.75000000],[1773625369000,96.80000000],[1773625690000,96.00000000],[1773626010000,96.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: [[1773615610000,1015.3],[1773615805000,1015.4],[1773616072000,1015.3],[1773616392000,1015.3],[1773616712000,1015.4],[1773616968000,1015.5],[1773617288000,1015.4],[1773617608000,1015.4],[1773617864000,1015.3],[1773618184000,1015.5],[1773618504000,1015.4],[1773618754000,1015.4],[1773619096000,1015.4],[1773619352000,1015.4],[1773619672000,1015.4],[1773619992000,1015.3],[1773620314000,1015.4],[1773620570000,1015.5],[1773620889000,1015.4],[1773621210000,1015.4],[1773621467000,1015.5],[1773621785000,1015.4],[1773622105000,1015.5],[1773622361000,1015.2],[1773622681000,1015.2],[1773623001000,1015.2],[1773623257000,1015.3],[1773623577000,1015.3],[1773623898000,1015.3],[1773624153000,1015.3],[1773624474000,1015.3],[1773624793000,1015.5],[1773625113000,1015.4],[1773625369000,1015.3],[1773625690000,1015.3],[1773626010000,1015.3],], 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: [[1773615610000,0],[1773615805000,0],[1773616072000,0],[1773616392000,0],[1773616712000,0],[1773616968000,0],[1773617288000,0],[1773617608000,0],[1773617864000,0],[1773618184000,0],[1773618504000,0],[1773618754000,0],[1773619096000,0],[1773619352000,0],[1773619672000,0],[1773619992000,0],[1773620314000,0],[1773620570000,0],[1773620889000,0],[1773621210000,0],[1773621467000,0],[1773621785000,0],[1773622105000,0],[1773622361000,0],[1773622681000,0],[1773623001000,0],[1773623257000,0],[1773623577000,0],[1773623898000,0],[1773624153000,0],[1773624474000,0],[1773624793000,0],[1773625113000,0],[1773625369000,0],[1773625690000,0],[1773626010000,0],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1773615610000,0],[1773615805000,0],[1773616072000,0],[1773616392000,0],[1773616712000,0],[1773616968000,0],[1773617288000,0],[1773617608000,0],[1773617864000,0],[1773618184000,0],[1773618504000,0],[1773618754000,0],[1773619096000,0],[1773619352000,0],[1773619672000,0],[1773619992000,0],[1773620314000,0],[1773620570000,0],[1773620889000,0],[1773621210000,0],[1773621467000,0],[1773621785000,0],[1773622105000,0],[1773622361000,0],[1773622681000,0],[1773623001000,0],[1773623257000,0],[1773623577000,0],[1773623898000,0],[1773624153000,0],[1773624474000,0],[1773624793000,0],[1773625113000,0],[1773625369000,0],[1773625690000,0],[1773626010000,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: [[1773615610000,17.00000000],[1773615805000,18.00000000],[1773616072000,17.40000000],[1773616392000,17.00000000],[1773616712000,17.00000000],[1773616968000,17.20000000],[1773617288000,18.00000000],[1773617608000,18.00000000],[1773617864000,17.40000000],[1773618184000,17.40000000],[1773618504000,18.00000000],[1773618754000,18.00000000],[1773619096000,18.00000000],[1773619352000,18.00000000],[1773619672000,17.60000000],[1773619992000,17.00000000],[1773620314000,17.50000000],[1773620570000,18.00000000],[1773620889000,17.00000000],[1773621210000,17.00000000],[1773621467000,17.60000000],[1773621785000,17.60000000],[1773622105000,17.00000000],[1773622361000,17.00000000],[1773622681000,17.00000000],[1773623001000,17.00000000],[1773623257000,17.00000000],[1773623577000,17.00000000],[1773623898000,17.00000000],[1773624153000,17.20000000],[1773624474000,19.60000000],[1773624793000,23.40000000],[1773625113000,20.25000000],[1773625369000,19.20000000],[1773625690000,18.80000000],[1773626010000,16.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: [[1773615610000,0.00000000],[1773615805000,0.00000000],[1773616072000,0.00000000],[1773616392000,0.00000000],[1773616712000,0.00000000],[1773616968000,0.00000000],[1773617288000,0.00000000],[1773617608000,0.00000000],[1773617864000,0.00000000],[1773618184000,0.00000000],[1773618504000,0.00000000],[1773618754000,0.00000000],[1773619096000,0.00000000],[1773619352000,0.00000000],[1773619672000,0.00000000],[1773619992000,0.00000000],[1773620314000,0.00000000],[1773620570000,0.00000000],[1773620889000,0.00000000],[1773621210000,0.00000000],[1773621467000,0.00000000],[1773621785000,0.00000000],[1773622105000,0.00000000],[1773622361000,0.00000000],[1773622681000,0.00000000],[1773623001000,0.00000000],[1773623257000,0.00000000],[1773623577000,0.00000000],[1773623898000,0.00000000],[1773624153000,0.00000000],[1773624474000,0.00000000],[1773624793000,0.00000000],[1773625113000,0.00000000],[1773625369000,0.00000000],[1773625690000,0.00000000],[1773626010000,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: [[1773615610000,0.00000000],[1773615805000,0.00000000],[1773616072000,0.00000000],[1773616392000,0.00000000],[1773616712000,0.00000000],[1773616968000,0.00000000],[1773617288000,0.00000000],[1773617608000,0.00000000],[1773617864000,0.00000000],[1773618184000,0.00000000],[1773618504000,0.00000000],[1773618754000,0.00000000],[1773619096000,0.00000000],[1773619352000,0.00000000],[1773619672000,0.00000000],[1773619992000,0.00000000],[1773620314000,0.00000000],[1773620570000,0.00000000],[1773620889000,0.00000000],[1773621210000,0.00000000],[1773621467000,0.00000000],[1773621785000,0.00000000],[1773622105000,0.00000000],[1773622361000,0.00000000],[1773622681000,0.00000000],[1773623001000,0.00000000],[1773623257000,0.00000000],[1773623577000,0.00000000],[1773623898000,0.00000000],[1773624153000,0.00000000],[1773624474000,0.00000000],[1773624793000,0.00000000],[1773625113000,0.00000000],[1773625369000,0.00000000],[1773625690000,0.00000000],[1773626010000,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: [[1773615610000,0.00000000],[1773615805000,0.00000000],[1773616072000,0.00000000],[1773616392000,0.00000000],[1773616712000,0.00000000],[1773616968000,0.00000000],[1773617288000,0.00000000],[1773617608000,0.00000000],[1773617864000,0.00000000],[1773618184000,0.00000000],[1773618504000,0.00000000],[1773618754000,0.00000000],[1773619096000,0.00000000],[1773619352000,0.00000000],[1773619672000,0.00000000],[1773619992000,0.00000000],[1773620314000,0.00000000],[1773620570000,0.00000000],[1773620889000,0.00000000],[1773621210000,0.00000000],[1773621467000,0.00000000],[1773621785000,0.00000000],[1773622105000,0.00000000],[1773622361000,0.00000000],[1773622681000,0.00000000],[1773623001000,0.00000000],[1773623257000,0.00000000],[1773623577000,0.00000000],[1773623898000,0.00000000],[1773624153000,0.00000000],[1773624474000,0.00000000],[1773624793000,0.00000000],[1773625113000,0.00000000],[1773625369000,0.00000000],[1773625690000,0.00000000],[1773626010000,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; }