var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1776290408000,13.20000000],[1776290600000,13.05000000],[1776290856000,12.80000000],[1776291176000,12.60000000],[1776291496000,12.75000000],[1776291751000,13.20000000],[1776292072000,13.54000000],[1776292392000,13.60000000],[1776292711000,13.60000000],[1776292968000,13.36000000],[1776293288000,13.12000000],[1776293608000,13.27500000],[1776293864000,13.32000000],[1776294184000,13.36000000],[1776294504000,13.25000000],[1776294760000,13.22000000],[1776295080000,13.36000000],[1776295400000,13.23333333],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1776290408000,8.7],[1776290600000,8.7],[1776290856000,8.7],[1776291176000,8.6],[1776291496000,8.6],[1776291751000,8.7],[1776292072000,8.8],[1776292392000,8.8],[1776292711000,8.9],[1776292968000,8.8],[1776293288000,8.7],[1776293608000,8.7],[1776293864000,8.7],[1776294184000,8.8],[1776294504000,8.8],[1776294760000,8.8],[1776295080000,8.8],[1776295400000,8.9],], 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: [[1776290408000,74.33333333],[1776290600000,75.00000000],[1776290856000,76.20000000],[1776291176000,77.00000000],[1776291496000,76.25000000],[1776291751000,74.60000000],[1776292072000,73.40000000],[1776292392000,73.00000000],[1776292711000,73.25000000],[1776292968000,74.20000000],[1776293288000,75.00000000],[1776293608000,74.00000000],[1776293864000,74.00000000],[1776294184000,74.00000000],[1776294504000,74.75000000],[1776294760000,74.80000000],[1776295080000,74.00000000],[1776295400000,75.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: [[1776290408000,1023.4],[1776290600000,1023.5],[1776290856000,1023.6],[1776291176000,1023.7],[1776291496000,1023.7],[1776291751000,1023.5],[1776292072000,1023.5],[1776292392000,1023.4],[1776292711000,1023.4],[1776292968000,1023.5],[1776293288000,1023.4],[1776293608000,1023.4],[1776293864000,1023.4],[1776294184000,1023.4],[1776294504000,1023.5],[1776294760000,1023.5],[1776295080000,1023.4],[1776295400000,1023.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: [[1776290408000,0.479999988],[1776290600000,0.09],[1776290856000,1.512],[1776291176000,2.016],[1776291496000,2.97],[1776291751000,1.872],[1776292072000,1.584],[1776292392000,0.432],[1776292711000,2.25],[1776292968000,0.576],[1776293288000,0.792],[1776293608000,0.63],[1776293864000,1.08],[1776294184000,0],[1776294504000,0],[1776294760000,0.648],[1776295080000,0.432],[1776295400000,0.240000012],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1776290408000,0.839999988],[1776290600000,0.63],[1776290856000,2.016],[1776291176000,2.52],[1776291496000,3.78],[1776291751000,2.52],[1776292072000,2.016],[1776292392000,1.512],[1776292711000,2.52],[1776292968000,2.016],[1776293288000,1.512],[1776293608000,0.63],[1776293864000,1.512],[1776294184000,0],[1776294504000,0],[1776294760000,2.016],[1776295080000,1.512],[1776295400000,1.680000012],], 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: [[1776290408000,13.66666667],[1776290600000,116.25000000],[1776290856000,266.00000000],[1776291176000,288.20000000],[1776291496000,311.50000000],[1776291751000,315.40000000],[1776292072000,258.80000000],[1776292392000,331.60000000],[1776292711000,334.75000000],[1776292968000,348.00000000],[1776293288000,348.60000000],[1776293608000,342.75000000],[1776293864000,336.00000000],[1776294184000,336.00000000],[1776294504000,336.75000000],[1776294760000,336.00000000],[1776295080000,336.00000000],[1776295400000,335.33333333],], 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: [[1776290408000,0.00000000],[1776290600000,0.00000000],[1776290856000,0.00000000],[1776291176000,0.00000000],[1776291496000,0.00000000],[1776291751000,0.00000000],[1776292072000,0.00000000],[1776292392000,0.00000000],[1776292711000,0.00000000],[1776292968000,0.00000000],[1776293288000,0.00000000],[1776293608000,0.00000000],[1776293864000,0.00000000],[1776294184000,0.00000000],[1776294504000,0.00000000],[1776294760000,0.00000000],[1776295080000,0.00000000],[1776295400000,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: [[1776290408000,0.00000000],[1776290600000,0.00000000],[1776290856000,0.00000000],[1776291176000,0.00000000],[1776291496000,0.00000000],[1776291751000,0.00000000],[1776292072000,0.00000000],[1776292392000,0.00000000],[1776292711000,0.00000000],[1776292968000,0.00000000],[1776293288000,0.00000000],[1776293608000,0.00000000],[1776293864000,0.00000000],[1776294184000,0.00000000],[1776294504000,0.00000000],[1776294760000,0.00000000],[1776295080000,0.00000000],[1776295400000,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: [[1776290408000,0.00000000],[1776290600000,0.00000000],[1776290856000,0.00000000],[1776291176000,0.00000000],[1776291496000,0.00000000],[1776291751000,0.00000000],[1776292072000,0.00000000],[1776292392000,0.00000000],[1776292711000,0.00000000],[1776292968000,0.00000000],[1776293288000,0.00000000],[1776293608000,0.00000000],[1776293864000,0.00000000],[1776294184000,0.00000000],[1776294504000,0.00000000],[1776294760000,0.00000000],[1776295080000,0.00000000],[1776295400000,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; }