var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1786092060000,29.90000000],[1786092180000,30.25000000],[1786092480000,30.72000000],[1786092840000,30.44000000],[1786093080000,30.26000000],[1786093380000,30.68000000],[1786093680000,30.68000000],[1786093980000,30.84000000],[1786094280000,30.86000000],[1786094580000,30.72000000],[1786094880000,30.82000000],[1786095240000,31.58000000],[1786095480000,31.94000000],[1786095840000,32.12000000],[1786096140000,32.48000000],[1786096440000,31.60000000],[1786096680000,31.56000000],[1786096980000,31.86000000],[1786097280000,32.16000000],[1786097580000,31.44000000],[1786097880000,31.94000000],[1786098180000,32.50000000],[1786098480000,32.30000000],[1786098780000,32.72000000],[1786099080000,32.64000000],[1786099380000,32.62000000],[1786099680000,32.44000000],[1786099980000,33.08000000],[1786100280000,32.82000000],[1786100580000,32.36000000],[1786100880000,32.42000000],[1786101180000,32.32000000],[1786101480000,32.04000000],[1786101780000,32.54000000],[1786102080000,32.72000000],[1786102380000,31.96000000],[1786102680000,31.46000000],[1786102980000,30.80000000],[1786103280000,29.84000000],[1786103580000,27.78000000],[1786103880000,27.02000000],[1786104180000,27.14000000],[1786104540000,27.28000000],[1786104780000,27.00000000],[1786105140000,26.18000000],[1786105380000,25.30000000],[1786105680000,24.60000000],[1786105980000,24.34000000],[1786106280000,23.80000000],[1786106580000,23.45000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1786092060000,22.3],[1786092180000,22.6],[1786092480000,21.9],[1786092840000,20.4],[1786093080000,20.1],[1786093380000,20.5],[1786093680000,20.6],[1786093980000,20.3],[1786094280000,20.8],[1786094580000,20.7],[1786094880000,20.7],[1786095240000,20.6],[1786095480000,20.2],[1786095840000,20.3],[1786096140000,20],[1786096440000,19.6],[1786096680000,19.4],[1786096980000,19.5],[1786097280000,19.3],[1786097580000,18.8],[1786097880000,18.8],[1786098180000,18.8],[1786098480000,18.8],[1786098780000,18.4],[1786099080000,18.6],[1786099380000,18.8],[1786099680000,18.6],[1786099980000,18.9],[1786100280000,18.7],[1786100580000,18.6],[1786100880000,18.7],[1786101180000,18.7],[1786101480000,18.5],[1786101780000,19],[1786102080000,18.9],[1786102380000,18.8],[1786102680000,18.7],[1786102980000,18.9],[1786103280000,18.8],[1786103580000,18.2],[1786103880000,17.6],[1786104180000,17.4],[1786104540000,17.5],[1786104780000,17.7],[1786105140000,17.8],[1786105380000,17.8],[1786105680000,18.1],[1786105980000,18.2],[1786106280000,17.9],[1786106580000,17.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: [[1786092060000,63.80000000],[1786092180000,63.77500000],[1786092480000,59.26000000],[1786092840000,55.06000000],[1786093080000,54.68000000],[1786093380000,54.48000000],[1786093680000,54.88000000],[1786093980000,53.34000000],[1786094280000,55.08000000],[1786094580000,55.02000000],[1786094880000,54.80000000],[1786095240000,52.04000000],[1786095480000,49.96000000],[1786095840000,49.74000000],[1786096140000,47.76000000],[1786096440000,48.80000000],[1786096680000,48.48000000],[1786096980000,48.04000000],[1786097280000,46.52000000],[1786097580000,46.96000000],[1786097880000,45.56000000],[1786098180000,44.32000000],[1786098480000,44.74000000],[1786098780000,42.66000000],[1786099080000,43.30000000],[1786099380000,43.78000000],[1786099680000,43.94000000],[1786099980000,42.94000000],[1786100280000,43.26000000],[1786100580000,43.88000000],[1786100880000,44.20000000],[1786101180000,44.34000000],[1786101480000,44.50000000],[1786101780000,44.68000000],[1786102080000,44.00000000],[1786102380000,45.68000000],[1786102680000,46.54000000],[1786102980000,49.06000000],[1786103280000,51.56000000],[1786103580000,55.94000000],[1786103880000,56.50000000],[1786104180000,55.28000000],[1786104540000,55.22000000],[1786104780000,56.70000000],[1786105140000,60.00000000],[1786105380000,63.38000000],[1786105680000,67.34000000],[1786105980000,68.78000000],[1786106280000,69.48000000],[1786106580000,70.05000000],], 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: 'Rýchlosť vetra (km/h)', data: [[1786092060000,7.92],[1786092180000,6.57],[1786092480000,9.864],[1786092780000,12.528],[1786093080000,8.28],[1786093380000,9.288],[1786093680000,11.592],[1786093980000,7.704],[1786094280000,12.096],[1786094580000,6.912],[1786094880000,9.144],[1786095180000,7.416],[1786095480000,11.52],[1786095780000,8.064],[1786096080000,9.288],[1786096380000,12.024],[1786096680000,7.704],[1786096980000,8.856],[1786097280000,12.744],[1786097580000,10.584],[1786097880000,7.92],[1786098180000,9.936],[1786098480000,7.2],[1786098780000,8.568],[1786099080000,6.336],[1786099380000,13.752],[1786099680000,6.552],[1786099980000,5.688],[1786100280000,10.224],[1786100580000,10.872],[1786100880000,12.6],[1786101180000,14.4],[1786101480000,11.736],[1786101780000,11.376],[1786102080000,14.688],[1786102380000,17.208],[1786102680000,15.696],[1786102980000,21.384],[1786103280000,30.528],[1786103580000,27.936],[1786103880000,26.784],[1786104180000,24.264],[1786104480000,19.728],[1786104780000,21.24],[1786105080000,23.184],[1786105380000,25.344],[1786105680000,20.448],[1786105980000,20.232],[1786106280000,24.984],[1786106580000,25.74],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1786092060000,11.52],[1786092180000,11.25],[1786092480000,15.624],[1786092780000,18.288],[1786093080000,13.248],[1786093380000,13.536],[1786093680000,19.44],[1786093980000,13.032],[1786094280000,17.136],[1786094580000,13.032],[1786094880000,14.184],[1786095180000,12.024],[1786095480000,17.352],[1786095780000,12.168],[1786096080000,13.968],[1786096380000,16.632],[1786096680000,12.6],[1786096980000,13.968],[1786097280000,19.008],[1786097580000,15.624],[1786097880000,13.32],[1786098180000,14.688],[1786098480000,11.232],[1786098780000,11.304],[1786099080000,12.312],[1786099380000,19.08],[1786099680000,9.792],[1786099980000,10.08],[1786100280000,16.92],[1786100580000,15.48],[1786100880000,21.24],[1786101180000,25.056],[1786101480000,16.92],[1786101780000,17.352],[1786102080000,21.744],[1786102380000,25.56],[1786102680000,28.08],[1786102980000,31.896],[1786103280000,48.096],[1786103580000,47.448],[1786103880000,42.984],[1786104180000,38.736],[1786104480000,28.656],[1786104780000,32.688],[1786105080000,35.928],[1786105380000,40.968],[1786105680000,31.608],[1786105980000,32.832],[1786106280000,39.816],[1786106580000,36.72],], 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: [[1786092060000,346.90000000],[1786092180000,316.30000000],[1786092480000,337.42000000],[1786092780000,196.50000000],[1786093080000,261.98000000],[1786093380000,81.72000000],[1786093680000,331.14000000],[1786093980000,333.30000000],[1786094280000,320.28000000],[1786094580000,313.54000000],[1786094880000,330.52000000],[1786095180000,280.12000000],[1786095480000,329.18000000],[1786095780000,139.34000000],[1786096080000,330.48000000],[1786096380000,320.50000000],[1786096680000,315.30000000],[1786096980000,300.90000000],[1786097280000,317.94000000],[1786097580000,327.16000000],[1786097880000,330.58000000],[1786098180000,269.74000000],[1786098480000,212.46000000],[1786098780000,334.02000000],[1786099080000,208.32000000],[1786099380000,325.62000000],[1786099680000,275.12000000],[1786099980000,78.52000000],[1786100280000,271.98000000],[1786100580000,328.10000000],[1786100880000,300.10000000],[1786101180000,322.98000000],[1786101480000,322.88000000],[1786101780000,320.42000000],[1786102080000,318.48000000],[1786102380000,318.92000000],[1786102680000,326.14000000],[1786102980000,311.06000000],[1786103280000,315.50000000],[1786103580000,312.66000000],[1786103880000,310.12000000],[1786104180000,314.96000000],[1786104480000,317.16000000],[1786104780000,320.66000000],[1786105080000,311.72000000],[1786105380000,308.86000000],[1786105680000,309.32000000],[1786105980000,312.36000000],[1786106280000,314.22000000],[1786106580000,309.40000000],], 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: 'Zrážky', data: [[1786092060000,0],[1786092180000,0],[1786092480000,0],[1786092840000,0],[1786093080000,0],[1786093380000,0],[1786093680000,0],[1786093980000,0],[1786094280000,0],[1786094580000,0],[1786094880000,0],[1786095240000,0],[1786095480000,0],[1786095840000,0],[1786096140000,0],[1786096440000,0],[1786096680000,0],[1786096980000,0],[1786097280000,0],[1786097580000,0],[1786097880000,0],[1786098180000,0],[1786098480000,0],[1786098780000,0],[1786099080000,0],[1786099380000,0],[1786099680000,0],[1786099980000,0],[1786100280000,0],[1786100580000,0],[1786100880000,0],[1786101180000,0],[1786101480000,0],[1786101780000,0],[1786102080000,0],[1786102380000,0],[1786102680000,0],[1786102980000,0],[1786103280000,0],[1786103580000,0],[1786103880000,0],[1786104180000,0],[1786104540000,0],[1786104780000,0],[1786105140000,0],[1786105380000,0],[1786105680000,0],[1786105980000,0],[1786106280000,0],[1786106580000,0],], 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; }