var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1776117629000,10.75000000],[1776117773000,10.87142857],[1776118093000,10.87500000],[1776118381000,10.77500000],[1776118669000,10.80000000],[1776118989000,10.78000000],[1776119309000,10.74000000],[1776119965000,10.68333333],[1776120205000,10.70000000],[1776120477000,10.60000000],[1776120781000,10.58750000],[1776121053000,10.56250000],[1776121373000,10.36666667],[1776121709000,10.45000000],[1776122045000,10.40000000],[1776122252000,10.42500000],[1776122589000,10.53333333],[1776122876000,10.68000000],[1776123196000,10.70000000],[1776123452000,10.77142857],[1776123805000,10.62857143],[1776124077000,10.48750000],[1776124381000,10.47500000],[1776124652000,10.42222222],[1776125005000,10.36250000],[1776125277000,10.58888889],[1776125580000,10.60000000],[1776125853000,10.68750000],[1776126173000,10.78888889],[1776126476000,10.86250000],[1776126780000,11.00000000],[1776127052000,11.12222222],[1776127372000,11.18888889],[1776127692000,11.14285714],[1776127981000,11.12000000],[1776128268000,11.34000000],[1776128588000,11.26666667],[1776128908000,11.16000000],[1776129180000,11.11428571],[1776129453000,11.18571429],[1776129837000,11.20000000],[1776130076000,11.15000000],[1776130381000,11.17142857],[1776130652000,11.10000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1776117629000,-1.7],[1776117773000,-1.7],[1776118093000,-1.7],[1776118381000,-1.7],[1776118669000,-1.8],[1776118989000,-1.9],[1776119309000,-2.1],[1776119965000,-2.1],[1776120205000,-2.1],[1776120477000,-2.1],[1776120781000,-2.1],[1776121053000,-2.2],[1776121373000,-2.1],[1776121709000,-2.2],[1776122045000,-2],[1776122252000,-2],[1776122589000,-2.2],[1776122876000,-2.1],[1776123196000,-1.9],[1776123452000,-2],[1776123805000,-1.9],[1776124077000,-2],[1776124381000,-2],[1776124652000,-2],[1776125005000,-2.1],[1776125277000,-1.9],[1776125580000,-1.9],[1776125853000,-1.8],[1776126173000,-1.9],[1776126476000,-1.9],[1776126780000,-1.9],[1776127052000,-1.9],[1776127372000,-2],[1776127692000,-2],[1776127981000,-2],[1776128268000,-2.1],[1776128588000,-1.8],[1776128908000,-1.9],[1776129180000,-1.9],[1776129453000,-2],[1776129837000,-2],[1776130076000,-1.9],[1776130381000,-1.8],[1776130652000,-1.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: [[1776117629000,42.25000000],[1776117773000,41.71428571],[1776118093000,41.75000000],[1776118381000,42.00000000],[1776118669000,41.71428571],[1776118989000,41.60000000],[1776119309000,41.00000000],[1776119965000,41.00000000],[1776120205000,41.12500000],[1776120477000,41.22222222],[1776120781000,41.50000000],[1776121053000,41.12500000],[1776121373000,42.00000000],[1776121709000,41.50000000],[1776122045000,42.25000000],[1776122252000,42.00000000],[1776122589000,41.33333333],[1776122876000,41.00000000],[1776123196000,41.60000000],[1776123452000,41.28571429],[1776123805000,42.00000000],[1776124077000,42.12500000],[1776124381000,42.12500000],[1776124652000,42.22222222],[1776125005000,42.00000000],[1776125277000,42.00000000],[1776125580000,42.00000000],[1776125853000,42.12500000],[1776126173000,41.33333333],[1776126476000,41.25000000],[1776126780000,40.85714286],[1776127052000,40.66666667],[1776127372000,40.00000000],[1776127692000,40.28571429],[1776127981000,40.20000000],[1776128268000,39.40000000],[1776128588000,40.33333333],[1776128908000,40.40000000],[1776129180000,40.42857143],[1776129453000,40.14285714],[1776129837000,40.16666667],[1776130076000,40.37500000],[1776130381000,40.57142857],[1776130652000,40.50000000],], 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: [[1776117629000,1017.6],[1776117773000,1017.5],[1776118093000,1017.5],[1776118381000,1017.5],[1776118669000,1017.6],[1776118989000,1017.5],[1776119309000,1017.6],[1776119965000,1017.8],[1776120205000,1017.8],[1776120477000,1017.9],[1776120781000,1017.8],[1776121053000,1017.8],[1776121373000,1017.9],[1776121709000,1017.9],[1776122045000,1017.9],[1776122252000,1017.9],[1776122589000,1017.7],[1776122876000,1017.8],[1776123196000,1017.7],[1776123452000,1017.7],[1776123805000,1017.7],[1776124077000,1017.8],[1776124381000,1017.8],[1776124652000,1017.7],[1776125005000,1017.6],[1776125277000,1017.6],[1776125580000,1017.5],[1776125853000,1017.6],[1776126173000,1017.5],[1776126476000,1017.4],[1776126780000,1017.6],[1776127052000,1017.6],[1776127372000,1017.6],[1776127692000,1017.6],[1776127981000,1017.5],[1776128268000,1017.6],[1776128588000,1017.5],[1776128908000,1017.6],[1776129180000,1017.6],[1776129453000,1017.6],[1776129837000,1017.6],[1776130076000,1017.6],[1776130381000,1017.6],[1776130652000,1017.7],], 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: [[1776117629000,6.93],[1776117773000,4.937142852],[1776118093000,4.68],[1776118381000,7.02],[1776118669000,5.4],[1776118989000,5.112],[1776119309000,4.608],[1776119965000,3.78],[1776120205000,3.78],[1776120477000,3.080000016],[1776120781000,3.735],[1776121053000,3.015],[1776121373000,2.760000012],[1776121709000,3.96],[1776122045000,2.97],[1776122252000,3.78],[1776122589000,5.159999988],[1776122876000,4.896],[1776123196000,3.168],[1776123452000,2.88],[1776123805000,2.468571444],[1776124077000,3.555],[1776124381000,4.68],[1776124652000,3.999999996],[1776125005000,7.2],[1776125277000,4.119999984],[1776125580000,4.275],[1776125853000,4.725],[1776126173000,4.880000016],[1776126476000,4.725],[1776126780000,4.32],[1776127052000,4.719999996],[1776127372000,4.719999996],[1776127692000,4.885714296],[1776127981000,6.336],[1776128268000,7.056],[1776128588000,5.22],[1776128908000,6.192],[1776129180000,3.754285704],[1776129453000,4.937142852],[1776129837000,4.5],[1776130076000,5.4],[1776130381000,5.605714296],[1776130652000,9.18],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1776117629000,10.89],[1776117773000,6.531428556],[1776118093000,5.67],[1776118381000,8.28],[1776118669000,7.2],[1776118989000,7.56],[1776119309000,6.552],[1776119965000,6.3],[1776120205000,5.985],[1776120477000,4.759999992],[1776120781000,5.985],[1776121053000,4.41],[1776121373000,4.200000012],[1776121709000,6.3],[1776122045000,5.04],[1776122252000,7.02],[1776122589000,7.56],[1776122876000,7.632],[1776123196000,4.032],[1776123452000,4.32],[1776123805000,4.32],[1776124077000,5.67],[1776124381000,7.29],[1776124652000,5.879999988],[1776125005000,9.54],[1776125277000,7.080000012],[1776125580000,6.3],[1776125853000,7.245],[1776126173000,6.999999984],[1776126476000,7.245],[1776126780000,6.171428556],[1776127052000,6.48],[1776127372000,7.599999996],[1776127692000,7.251428556],[1776127981000,8.64],[1776128268000,10.8],[1776128588000,7.139999988],[1776128908000,10.8],[1776129180000,6.891428556],[1776129453000,7.92],[1776129837000,6.3],[1776130076000,7.29],[1776130381000,8.331428556],[1776130652000,14.04],], 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: [[1776117629000,89.25000000],[1776117773000,155.14285714],[1776118093000,183.00000000],[1776118381000,51.75000000],[1776118669000,118.85714286],[1776118989000,115.60000000],[1776119309000,121.40000000],[1776119965000,122.16666667],[1776120205000,94.62500000],[1776120477000,194.88888889],[1776120781000,184.50000000],[1776121053000,174.00000000],[1776121373000,146.33333333],[1776121709000,172.16666667],[1776122045000,46.00000000],[1776122252000,70.50000000],[1776122589000,120.66666667],[1776122876000,104.40000000],[1776123196000,249.00000000],[1776123452000,144.28571429],[1776123805000,233.00000000],[1776124077000,236.00000000],[1776124381000,208.25000000],[1776124652000,107.88888889],[1776125005000,80.00000000],[1776125277000,123.00000000],[1776125580000,97.12500000],[1776125853000,142.87500000],[1776126173000,134.00000000],[1776126476000,105.12500000],[1776126780000,167.14285714],[1776127052000,72.66666667],[1776127372000,172.11111111],[1776127692000,176.71428571],[1776127981000,83.40000000],[1776128268000,171.00000000],[1776128588000,114.66666667],[1776128908000,69.60000000],[1776129180000,223.71428571],[1776129453000,147.00000000],[1776129837000,103.50000000],[1776130076000,97.50000000],[1776130381000,106.42857143],[1776130652000,72.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: [[1776117629000,0.00000000],[1776117773000,0.00000000],[1776118093000,0.00000000],[1776118381000,0.00000000],[1776118669000,0.00000000],[1776118989000,0.00000000],[1776119309000,0.00000000],[1776119965000,0.00000000],[1776120205000,0.00000000],[1776120477000,0.00000000],[1776120781000,0.00000000],[1776121053000,0.00000000],[1776121373000,0.00000000],[1776121709000,0.00000000],[1776122045000,0.00000000],[1776122252000,0.00000000],[1776122589000,0.00000000],[1776122876000,0.00000000],[1776123196000,0.00000000],[1776123452000,0.00000000],[1776123805000,0.00000000],[1776124077000,0.00000000],[1776124381000,0.00000000],[1776124652000,0.00000000],[1776125005000,0.00000000],[1776125277000,0.00000000],[1776125580000,0.00000000],[1776125853000,0.00000000],[1776126173000,0.00000000],[1776126476000,0.00000000],[1776126780000,0.00000000],[1776127052000,0.00000000],[1776127372000,0.00000000],[1776127692000,0.00000000],[1776127981000,0.00000000],[1776128268000,0.00000000],[1776128588000,0.00000000],[1776128908000,0.00000000],[1776129180000,0.00000000],[1776129453000,0.00000000],[1776129837000,0.00000000],[1776130076000,0.00000000],[1776130381000,0.00000000],[1776130652000,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: [[1776117629000,0.00000000],[1776117773000,0.00000000],[1776118093000,0.00000000],[1776118381000,0.00000000],[1776118669000,0.00000000],[1776118989000,0.00000000],[1776119309000,0.00000000],[1776119965000,0.00000000],[1776120205000,0.00000000],[1776120477000,0.00000000],[1776120781000,0.00000000],[1776121053000,0.00000000],[1776121373000,0.00000000],[1776121709000,0.00000000],[1776122045000,0.00000000],[1776122252000,0.00000000],[1776122589000,0.00000000],[1776122876000,0.00000000],[1776123196000,0.00000000],[1776123452000,0.00000000],[1776123805000,0.00000000],[1776124077000,0.00000000],[1776124381000,0.00000000],[1776124652000,0.00000000],[1776125005000,0.00000000],[1776125277000,0.00000000],[1776125580000,0.00000000],[1776125853000,0.00000000],[1776126173000,0.00000000],[1776126476000,0.00000000],[1776126780000,0.00000000],[1776127052000,0.00000000],[1776127372000,0.00000000],[1776127692000,0.00000000],[1776127981000,0.00000000],[1776128268000,0.00000000],[1776128588000,0.00000000],[1776128908000,0.00000000],[1776129180000,0.00000000],[1776129453000,0.00000000],[1776129837000,0.00000000],[1776130076000,0.00000000],[1776130381000,0.00000000],[1776130652000,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: [[1776117629000,0.00000000],[1776117773000,0.00000000],[1776118093000,0.00000000],[1776118381000,0.00000000],[1776118669000,0.00000000],[1776118989000,0.00000000],[1776119309000,0.00000000],[1776119965000,0.00000000],[1776120205000,0.00000000],[1776120477000,0.00000000],[1776120781000,0.00000000],[1776121053000,0.00000000],[1776121373000,0.00000000],[1776121709000,0.00000000],[1776122045000,0.00000000],[1776122252000,0.00000000],[1776122589000,0.00000000],[1776122876000,0.00000000],[1776123196000,0.00000000],[1776123452000,0.00000000],[1776123805000,0.00000000],[1776124077000,0.00000000],[1776124381000,0.00000000],[1776124652000,0.00000000],[1776125005000,0.00000000],[1776125277000,0.00000000],[1776125580000,0.00000000],[1776125853000,0.00000000],[1776126173000,0.00000000],[1776126476000,0.00000000],[1776126780000,0.00000000],[1776127052000,0.00000000],[1776127372000,0.00000000],[1776127692000,0.00000000],[1776127981000,0.00000000],[1776128268000,0.00000000],[1776128588000,0.00000000],[1776128908000,0.00000000],[1776129180000,0.00000000],[1776129453000,0.00000000],[1776129837000,0.00000000],[1776130076000,0.00000000],[1776130381000,0.00000000],[1776130652000,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; }