var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1785362433000,22.13333333],[1785362573000,22.28750000],[1785362877000,21.92222222],[1785363182000,21.97500000],[1785363469000,22.10000000],[1785363789000,21.73333333],[1785364109000,21.50000000],[1785364493000,21.30000000],[1785364669000,21.40000000],[1785364973000,21.60000000],[1785365277000,21.42500000],[1785365581000,20.92857143],[1785365852000,20.73750000],[1785366205000,20.82857143],[1785366477000,21.13750000],[1785366781000,21.25714286],[1785367052000,21.43750000],[1785367405000,21.38571429],[1785367677000,21.08888889],[1785367981000,20.72000000],[1785368252000,20.51428571],[1785368573000,20.32000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1785362433000,12.4],[1785362573000,13.1],[1785362877000,12.7],[1785363182000,12.7],[1785363469000,12.6],[1785363789000,12.9],[1785364109000,12.7],[1785364493000,12.4],[1785364669000,12.5],[1785364973000,12.5],[1785365277000,12.8],[1785365581000,12.9],[1785365852000,12.5],[1785366205000,12.5],[1785366477000,12.5],[1785366781000,12.4],[1785367052000,12.4],[1785367405000,12.5],[1785367677000,12.7],[1785367981000,12.6],[1785368252000,12.6],[1785368573000,12.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: [[1785362433000,54.00000000],[1785362573000,56.00000000],[1785362877000,55.77777778],[1785363182000,55.75000000],[1785363469000,55.00000000],[1785363789000,57.16666667],[1785364109000,57.50000000],[1785364493000,57.00000000],[1785364669000,57.00000000],[1785364973000,56.33333333],[1785365277000,58.12500000],[1785365581000,60.14285714],[1785365852000,59.37500000],[1785366205000,59.14285714],[1785366477000,57.87500000],[1785366781000,57.00000000],[1785367052000,56.50000000],[1785367405000,57.14285714],[1785367677000,58.88888889],[1785367981000,59.80000000],[1785368252000,60.42857143],[1785368573000,62.40000000],], 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: [[1785362433000,1021.3],[1785362573000,1021.4],[1785362877000,1021.5],[1785363182000,1021.5],[1785363469000,1021.4],[1785363789000,1021.4],[1785364109000,1021.6],[1785364493000,1021.5],[1785364669000,1021.5],[1785364973000,1021.4],[1785365277000,1021.5],[1785365581000,1021.5],[1785365852000,1021.6],[1785366205000,1021.6],[1785366477000,1021.5],[1785366781000,1021.5],[1785367052000,1021.5],[1785367405000,1021.6],[1785367677000,1021.6],[1785367981000,1021.6],[1785368252000,1021.6],[1785368573000,1021.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: [[1785362433000,0.960000012],[1785362573000,2.115],[1785362877000,1.400000004],[1785363182000,0],[1785363469000,0.864],[1785363789000,2.220000012],[1785364109000,0.54],[1785364493000,0],[1785364669000,0.144],[1785364973000,1.739999988],[1785365277000,0.855],[1785365581000,0.308571444],[1785365852000,0.36],[1785366205000,0.668571444],[1785366477000,0.315],[1785366781000,0.462857148],[1785367052000,0.27],[1785367405000,0],[1785367677000,0.039999996],[1785367981000,0],[1785368252000,1.131428556],[1785368573000,0.36],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1785362433000,1.680000012],[1785362573000,2.52],[1785362877000,1.959999984],[1785363182000,0],[1785363469000,1.512],[1785363789000,2.940000012],[1785364109000,2.52],[1785364493000,0],[1785364669000,1.008],[1785364973000,2.099999988],[1785365277000,1.26],[1785365581000,0.36],[1785365852000,1.26],[1785366205000,1.44],[1785366477000,0.63],[1785366781000,1.08],[1785367052000,0.63],[1785367405000,0],[1785367677000,0.280000008],[1785367981000,0],[1785368252000,1.44],[1785368573000,1.008],], 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: [[1785362433000,290.33333333],[1785362573000,292.37500000],[1785362877000,300.00000000],[1785363182000,310.25000000],[1785363469000,305.20000000],[1785363789000,287.00000000],[1785364109000,317.00000000],[1785364493000,311.33333333],[1785364669000,303.40000000],[1785364973000,316.83333333],[1785365277000,297.75000000],[1785365581000,307.57142857],[1785365852000,303.37500000],[1785366205000,296.71428571],[1785366477000,303.25000000],[1785366781000,298.14285714],[1785367052000,301.87500000],[1785367405000,303.42857143],[1785367677000,307.00000000],[1785367981000,309.80000000],[1785368252000,297.71428571],[1785368573000,301.60000000],], 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: [[1785362433000,0.00000000],[1785362573000,0.00000000],[1785362877000,0.00000000],[1785363182000,0.00000000],[1785363469000,0.00000000],[1785363789000,0.00000000],[1785364109000,0.00000000],[1785364493000,0.00000000],[1785364669000,0.00000000],[1785364973000,0.00000000],[1785365277000,0.00000000],[1785365581000,0.00000000],[1785365852000,0.00000000],[1785366205000,0.00000000],[1785366477000,0.00000000],[1785366781000,0.00000000],[1785367052000,0.00000000],[1785367405000,0.00000000],[1785367677000,0.00000000],[1785367981000,0.00000000],[1785368252000,0.00000000],[1785368573000,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: [[1785362433000,0.00000000],[1785362573000,0.00000000],[1785362877000,0.00000000],[1785363182000,0.00000000],[1785363469000,0.00000000],[1785363789000,0.00000000],[1785364109000,0.00000000],[1785364493000,0.00000000],[1785364669000,0.00000000],[1785364973000,0.00000000],[1785365277000,0.00000000],[1785365581000,0.00000000],[1785365852000,0.00000000],[1785366205000,0.00000000],[1785366477000,0.00000000],[1785366781000,0.00000000],[1785367052000,0.00000000],[1785367405000,0.00000000],[1785367677000,0.00000000],[1785367981000,0.00000000],[1785368252000,0.00000000],[1785368573000,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: [[1785362433000,0.00000000],[1785362573000,0.00000000],[1785362877000,0.00000000],[1785363182000,0.00000000],[1785363469000,0.00000000],[1785363789000,0.00000000],[1785364109000,0.00000000],[1785364493000,0.00000000],[1785364669000,0.00000000],[1785364973000,0.00000000],[1785365277000,0.00000000],[1785365581000,0.00000000],[1785365852000,0.00000000],[1785366205000,0.00000000],[1785366477000,0.00000000],[1785366781000,0.00000000],[1785367052000,0.00000000],[1785367405000,0.00000000],[1785367677000,0.00000000],[1785367981000,0.00000000],[1785368252000,0.00000000],[1785368573000,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; }