var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1773183722000,4.70000000],[1773183786000,4.56000000],[1773184086000,4.30000000],[1773187099000,2.97500000],[1773187387000,2.80000000],[1773187893000,2.70000000],[1773187986000,2.63333333],[1773188484000,2.70000000],[1773188587000,2.70000000],[1773189246000,2.60000000],[1773189486000,2.50000000],[1773204599000,2.05000000],[1773204791000,2.00000000],[1773205302000,1.90000000],[1773205391000,1.85000000],[1773210913000,7.00000000],[1773211093000,7.25000000],[1773211768000,7.55000000],[1773211994000,7.50000000],[1773214346000,7.90000000],[1773214404000,8.05000000],[1773214670000,8.25000000],[1773214962000,8.48000000],[1773215285000,8.54000000],[1773215733000,8.95000000],[1773215953000,9.03333333],[1773216211000,9.17500000],[1773216488000,9.52000000],[1773216842000,9.90000000],[1773217142000,10.50000000],[1773217394000,10.60000000],[1773225924000,14.60000000],[1773226098000,14.93333333],[1773230172000,14.80000000],[1773230308000,15.36666667],[1773232459000,15.90000000],[1773232702000,15.80000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1773183722000,2.4],[1773183786000,2.3],[1773184086000,2.1],[1773187099000,1.3],[1773187387000,1.3],[1773187893000,1.2],[1773187986000,1.1],[1773188484000,1.3],[1773188587000,1.4],[1773189246000,1.3],[1773189486000,1.2],[1773204599000,0.9],[1773204791000,0.8],[1773205302000,0.7],[1773205391000,0.7],[1773210913000,3.4],[1773211093000,3.3],[1773211768000,3.3],[1773211994000,3.2],[1773214346000,3.3],[1773214404000,3.5],[1773214670000,3.4],[1773214962000,3.6],[1773215285000,3.7],[1773215733000,3.9],[1773215953000,3.8],[1773216211000,3.9],[1773216488000,4.1],[1773216842000,4.2],[1773217142000,4.2],[1773217394000,4.2],[1773225924000,6.2],[1773226098000,6.5],[1773230172000,6.3],[1773230308000,6.7],[1773232459000,6.9],[1773232702000,6.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: [[1773183722000,85.00000000],[1773183786000,85.20000000],[1773184086000,86.00000000],[1773187099000,89.00000000],[1773187387000,89.80000000],[1773187893000,90.00000000],[1773187986000,90.00000000],[1773188484000,90.50000000],[1773188587000,91.00000000],[1773189246000,91.00000000],[1773189486000,91.00000000],[1773204599000,92.00000000],[1773204791000,92.00000000],[1773205302000,92.00000000],[1773205391000,92.00000000],[1773210913000,78.00000000],[1773211093000,76.50000000],[1773211768000,74.50000000],[1773211994000,74.50000000],[1773214346000,73.00000000],[1773214404000,73.00000000],[1773214670000,72.00000000],[1773214962000,71.80000000],[1773215285000,71.80000000],[1773215733000,71.00000000],[1773215953000,70.00000000],[1773216211000,70.00000000],[1773216488000,69.20000000],[1773216842000,68.00000000],[1773217142000,65.50000000],[1773217394000,65.00000000],[1773225924000,57.50000000],[1773226098000,57.33333333],[1773230172000,57.00000000],[1773230308000,56.33333333],[1773232459000,55.25000000],[1773232702000,55.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: [[1773183722000,1021.8],[1773183786000,1021.7],[1773184086000,1021.8],[1773187099000,1021.5],[1773187387000,1021.5],[1773187893000,1021.4],[1773187986000,1021.4],[1773188484000,1021.6],[1773188587000,1021.6],[1773189246000,1021.6],[1773189486000,1021.7],[1773204599000,1021.7],[1773204791000,1021.7],[1773205302000,1021.8],[1773205391000,1021.7],[1773210913000,1021.6],[1773211093000,1021.6],[1773211768000,1021.6],[1773211994000,1021.6],[1773214346000,1021.8],[1773214404000,1021.8],[1773214670000,1021.7],[1773214962000,1021.7],[1773215285000,1021.6],[1773215733000,1021.5],[1773215953000,1021.6],[1773216211000,1021.5],[1773216488000,1021.5],[1773216842000,1021.5],[1773217142000,1021.5],[1773217394000,1021.4],[1773225924000,1021.3],[1773226098000,1021.2],[1773230172000,1020.4],[1773230308000,1020.2],[1773232459000,1019.6],[1773232702000,1019.5],], 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: [[1773183722000,0],[1773183786000,0],[1773184086000,0],[1773187099000,0],[1773187387000,0],[1773187893000,0],[1773187986000,0],[1773188484000,0],[1773188587000,0],[1773189246000,0],[1773189486000,0],[1773204599000,0],[1773204791000,0],[1773205302000,0],[1773205391000,0],[1773210913000,0],[1773211093000,1.98],[1773211768000,3.6],[1773211994000,0.72],[1773214346000,2.52],[1773214404000,0.18],[1773214670000,0.54],[1773214962000,1.44],[1773215285000,2.376],[1773215733000,3.42],[1773215953000,2.88],[1773216211000,1.71],[1773216488000,2.16],[1773216842000,2.88],[1773217142000,2.34],[1773217394000,6.12],[1773225924000,2.88],[1773226098000,1.08],[1773230172000,0.72],[1773230308000,0.36],[1773232459000,3.78],[1773232702000,5.04],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1773183722000,0],[1773183786000,0],[1773184086000,0],[1773187099000,0],[1773187387000,0],[1773187893000,0],[1773187986000,0],[1773188484000,0],[1773188587000,0],[1773189246000,0],[1773189486000,0],[1773204599000,0],[1773204791000,0],[1773205302000,0],[1773205391000,0],[1773210913000,0],[1773211093000,3.78],[1773211768000,6.3],[1773211994000,1.26],[1773214346000,2.52],[1773214404000,1.26],[1773214670000,1.26],[1773214962000,2.52],[1773215285000,4.536],[1773215733000,6.3],[1773215953000,4.200000012],[1773216211000,3.15],[1773216488000,4.536],[1773216842000,5.04],[1773217142000,3.78],[1773217394000,10.08],[1773225924000,3.78],[1773226098000,3.359999988],[1773230172000,3.78],[1773230308000,0.839999988],[1773232459000,5.67],[1773232702000,12.96],], 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: [[1773183722000,81.00000000],[1773183786000,81.00000000],[1773184086000,76.00000000],[1773187099000,90.00000000],[1773187387000,88.80000000],[1773187893000,80.00000000],[1773187986000,86.00000000],[1773188484000,78.00000000],[1773188587000,85.66666667],[1773189246000,84.00000000],[1773189486000,82.50000000],[1773204599000,83.00000000],[1773204791000,79.50000000],[1773205302000,85.00000000],[1773205391000,76.00000000],[1773210913000,81.33333333],[1773211093000,54.00000000],[1773211768000,27.50000000],[1773211994000,77.50000000],[1773214346000,37.00000000],[1773214404000,87.00000000],[1773214670000,85.50000000],[1773214962000,67.80000000],[1773215285000,119.80000000],[1773215733000,85.50000000],[1773215953000,113.00000000],[1773216211000,63.25000000],[1773216488000,66.40000000],[1773216842000,78.00000000],[1773217142000,56.50000000],[1773217394000,72.00000000],[1773225924000,166.50000000],[1773226098000,147.33333333],[1773230172000,55.00000000],[1773230308000,111.33333333],[1773232459000,139.25000000],[1773232702000,137.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: [[1773183722000,0.00000000],[1773183786000,0.00000000],[1773184086000,0.00000000],[1773187099000,0.00000000],[1773187387000,0.00000000],[1773187893000,0.00000000],[1773187986000,0.00000000],[1773188484000,0.00000000],[1773188587000,0.00000000],[1773189246000,0.00000000],[1773189486000,0.00000000],[1773204599000,0.00000000],[1773204791000,0.00000000],[1773205302000,1.00000000],[1773205391000,1.00000000],[1773210913000,45.00000000],[1773211093000,46.00000000],[1773211768000,52.50000000],[1773211994000,54.00000000],[1773214346000,73.00000000],[1773214404000,74.00000000],[1773214670000,76.00000000],[1773214962000,82.60000000],[1773215285000,159.00000000],[1773215733000,193.00000000],[1773215953000,180.33333333],[1773216211000,212.00000000],[1773216488000,220.20000000],[1773216842000,225.00000000],[1773217142000,236.00000000],[1773217394000,240.00000000],[1773225924000,373.00000000],[1773226098000,376.00000000],[1773230172000,341.00000000],[1773230308000,339.33333333],[1773232459000,309.25000000],[1773232702000,303.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: [[1773183722000,0.00000000],[1773183786000,0.00000000],[1773184086000,0.00000000],[1773187099000,0.00000000],[1773187387000,0.00000000],[1773187893000,0.00000000],[1773187986000,0.00000000],[1773188484000,0.00000000],[1773188587000,0.00000000],[1773189246000,0.00000000],[1773189486000,0.00000000],[1773204599000,0.00000000],[1773204791000,0.00000000],[1773205302000,0.00000000],[1773205391000,0.00000000],[1773210913000,0.00000000],[1773211093000,0.00000000],[1773211768000,0.00000000],[1773211994000,0.00000000],[1773214346000,0.00000000],[1773214404000,0.00000000],[1773214670000,0.00000000],[1773214962000,0.00000000],[1773215285000,1.00000000],[1773215733000,1.00000000],[1773215953000,1.00000000],[1773216211000,2.00000000],[1773216488000,2.00000000],[1773216842000,2.00000000],[1773217142000,2.00000000],[1773217394000,2.00000000],[1773225924000,3.00000000],[1773226098000,3.00000000],[1773230172000,3.00000000],[1773230308000,3.00000000],[1773232459000,2.50000000],[1773232702000,2.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: [[1773183722000,0.00000000],[1773183786000,0.00000000],[1773184086000,0.00000000],[1773187099000,0.00000000],[1773187387000,0.00000000],[1773187893000,0.00000000],[1773187986000,0.00000000],[1773188484000,0.00000000],[1773188587000,0.00000000],[1773189246000,0.00000000],[1773189486000,0.00000000],[1773204599000,0.00000000],[1773204791000,0.00000000],[1773205302000,0.00000000],[1773205391000,0.00000000],[1773210913000,0.00000000],[1773211093000,0.00000000],[1773211768000,0.00000000],[1773211994000,0.00000000],[1773214346000,0.00000000],[1773214404000,0.00000000],[1773214670000,0.00000000],[1773214962000,0.00000000],[1773215285000,0.00000000],[1773215733000,0.00000000],[1773215953000,0.00000000],[1773216211000,0.00000000],[1773216488000,0.00000000],[1773216842000,0.00000000],[1773217142000,0.00000000],[1773217394000,0.00000000],[1773225924000,0.00000000],[1773226098000,0.00000000],[1773230172000,0.00000000],[1773230308000,0.00000000],[1773232459000,0.00000000],[1773232702000,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; }