var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1642806002000,-4.76666667],[1642806181000,-4.84000000],[1642806482000,-4.60000000],[1642806782000,-4.52000000],[1642807081000,-4.30000000],[1642807381000,-3.82000000],[1642807682000,-3.50000000],[1642807982000,-3.56000000],[1642808342000,-3.36666667],[1642808581000,-3.20000000],[1642808881000,-3.20000000],[1642809182000,-2.92000000],[1642809482000,-2.88000000],[1642809784000,-2.80000000],[1642810084000,-2.67500000],[1642810443000,-2.72500000],[1642810682000,-2.40000000],[1642810984000,-2.42000000],[1642811282000,-2.56000000],[1642811581000,-2.72000000],[1642811881000,-2.80000000],[1642812181000,-2.92000000],[1642812482000,-2.90000000],[1642812781000,-2.90000000],[1642813081000,-2.90000000],[1642813381000,-2.92000000],[1642813684000,-3.00000000],[1642813981000,-2.90000000],[1642814282000,-2.80000000],[1642814583000,-2.56666667],[1642814884000,-2.42000000],[1642815181000,-2.26666667],[1642815482000,-2.20000000],[1642815783000,-2.10000000],[1642816081000,-2.00000000],[1642816384000,-1.96666667],[1642816683000,-1.95000000],[1642816982000,-2.02000000],[1642817281000,-2.00000000],[1642817581000,-2.00000000],[1642817882000,-2.00000000],[1642818181000,-2.03333333],[1642818544000,-2.05000000],[1642818781000,-2.12500000],[1642819081000,-2.20000000],[1642819444000,-2.13333333],[1642819681000,-2.20000000],[1642819981000,-2.22500000],[1642820344000,-2.22500000],[1642820581000,-2.26000000],[1642820881000,-2.40000000],[1642821243000,-2.57500000],[1642821481000,-2.62000000],[1642821782000,-2.64000000],[1642822204000,-2.73333333],[1642822383000,-2.80000000],[1642822681000,-2.86666667],[1642822981000,-2.98000000],[1642823281000,-3.00000000],[1642823644000,-3.10000000],[1642823882000,-3.20000000],[1642824181000,-3.20000000],[1642824481000,-3.20000000],[1642824782000,-3.26666667],[1642825082000,-3.38000000],[1642825381000,-3.46666667],[1642825683000,-3.52000000],[1642825981000,-3.56000000],[1642826282000,-3.66000000],[1642826582000,-3.60000000],[1642826881000,-3.60000000],[1642827181000,-3.52000000],[1642827481000,-3.70000000],[1642827782000,-3.86000000],[1642828081000,-4.08000000],[1642828382000,-4.30000000],[1642828682000,-4.34000000],[1642828981000,-4.44000000],[1642829282000,-4.52000000],[1642829581000,-4.66000000],[1642829881000,-4.54000000],[1642830182000,-4.48000000],[1642830481000,-4.42000000],[1642830781000,-4.48000000],[1642831082000,-4.26000000],[1642831381000,-3.94000000],[1642831681000,-3.24000000],[1642832042000,-3.17500000],[1642832282000,-3.36000000],[1642832581000,-4.54000000],[1642832881000,-4.00000000],[1642833182000,-4.06000000],[1642833541000,-4.57500000],[1642833781000,-4.64000000],[1642834082000,-4.32000000],[1642834382000,-4.22500000],[1642834681000,-4.72500000],[1642834982000,-4.93333333],[1642835282000,-4.78000000],[1642835582000,-4.82500000],[1642835884000,-5.92000000],[1642836182000,-6.35000000],[1642836544000,-6.10000000],[1642836782000,-5.70000000],[1642837081000,-5.36000000],[1642837382000,-4.96000000],[1642837682000,-4.60000000],[1642837981000,-4.22000000],[1642838282000,-3.98000000],[1642838582000,-3.74000000],[1642838881000,-4.02000000],[1642839181000,-4.08000000],[1642839482000,-3.54000000],[1642839781000,-3.18000000],[1642840082000,-2.64000000],[1642840381000,-2.47500000],[1642840682000,-2.22000000],[1642840983000,-1.82000000],[1642841282000,-1.56000000],[1642841581000,-1.34000000],[1642841882000,-1.10000000],[1642842181000,-0.70000000],[1642842481000,-0.60000000],[1642842782000,-0.24000000],[1642843081000,0.00000000],[1642843381000,0.18000000],[1642843682000,0.30000000],[1642843983000,0.40000000],[1642844281000,0.50000000],[1642844582000,0.40000000],[1642844881000,0.46000000],[1642845304000,0.25000000],[1642845483000,0.50000000],[1642845781000,0.54000000],[1642846082000,0.42500000],[1642846384000,0.38000000],[1642846681000,0.44000000],[1642846981000,0.20000000],[1642847283000,0.46666667],[1642847584000,0.37500000],[1642847881000,0.40000000],[1642848184000,0.42000000],[1642848482000,0.47500000],[1642848782000,0.67500000],[1642849083000,0.60000000],[1642849382000,0.54000000],[1642849681000,0.40000000],[1642849984000,0.42000000],[1642850283000,0.75000000],[1642850641000,0.90000000],[1642850884000,0.80000000],[1642851181000,0.80000000],[1642851542000,0.80000000],[1642851781000,0.76000000],[1642852082000,0.65000000],[1642852441000,0.65000000],[1642852684000,0.72500000],[1642852983000,0.60000000],[1642853343000,0.65000000],[1642853582000,0.72500000],[1642853882000,0.72000000],[1642854243000,0.77500000],[1642854543000,0.65000000],[1642854781000,0.70000000],[1642855081000,0.80000000],[1642855381000,0.85000000],[1642855683000,1.10000000],[1642855981000,1.05000000],[1642856283000,0.96666667],[1642856583000,0.96000000],[1642856881000,1.00000000],[1642857181000,1.16000000],[1642857482000,0.96000000],[1642857782000,0.92500000],[1642858141000,0.90000000],[1642858383000,0.78000000],[1642858682000,0.80000000],[1642858982000,0.68000000],[1642859282000,0.43333333],[1642859581000,0.22500000],[1642859944000,0.20000000],[1642860184000,0.20000000],[1642860544000,0.20000000],[1642860842000,0.20000000],[1642861084000,0.05000000],[1642861444000,-0.20000000],[1642861683000,-0.37500000],[1642862103000,-0.50000000],[1642862283000,-0.43333333],[1642862582000,-0.42000000],[1642862882000,-0.50000000],[1642863244000,-0.40000000],[1642863484000,-0.66666667],[1642863844000,-0.75000000],[1642864083000,-0.85000000],[1642864383000,-0.85000000],[1642864682000,-0.90000000],[1642865104000,-1.10000000],[1642865344000,-1.07500000],[1642865581000,-1.36000000],[1642865941000,-1.56666667],[1642866181000,-1.46666667],[1642866481000,-1.45000000],[1642866783000,-1.42000000],[1642867084000,-1.42500000],[1642867381000,-1.47500000],[1642867743000,-1.55000000],[1642867981000,-1.52500000],[1642868284000,-1.57500000],[1642868582000,-1.62500000],[1642868884000,-1.86000000],[1642869243000,-1.63333333],[1642869484000,-1.76666667],[1642869783000,-1.65000000],[1642870084000,-1.64000000],[1642870381000,-1.73333333],[1642870684000,-2.16000000],[1642870982000,-2.32000000],[1642871283000,-2.43333333],[1642871582000,-2.10000000],[1642871882000,-2.15000000],[1642872182000,-2.22500000],[1642872543000,-2.16666667],[1642872784000,-1.95000000],[1642873084000,-1.90000000],[1642873381000,-1.77500000],[1642873684000,-1.82500000],[1642873982000,-1.80000000],[1642874283000,-1.84000000],[1642874581000,-2.03333333],[1642874944000,-2.20000000],[1642875243000,-2.10000000],[1642875484000,-2.48000000],[1642875781000,-2.75000000],[1642876081000,-3.08000000],[1642876382000,-2.80000000],[1642876681000,-2.46666667],[1642877042000,-2.85000000],[1642877282000,-3.00000000],[1642877581000,-2.56000000],[1642877884000,-2.75000000],[1642878183000,-2.85000000],[1642878482000,-2.86666667],[1642878784000,-2.76666667],[1642879083000,-2.42500000],[1642879383000,-2.36000000],[1642879684000,-2.45000000],[1642879981000,-2.64000000],[1642880286000,-3.20000000],[1642880584000,-3.62000000],[1642880884000,-3.60000000],[1642881243000,-3.32500000],[1642881483000,-3.45000000],[1642881782000,-3.85000000],[1642882143000,-3.25000000],[1642882443000,-3.36666667],[1642882681000,-3.20000000],[1642882983000,-3.40000000],[1642883344000,-3.55000000],[1642883584000,-3.82500000],[1642883943000,-3.63333333],[1642884184000,-3.08000000],[1642884482000,-3.40000000],[1642884781000,-4.37500000],[1642885083000,-4.78000000],[1642885381000,-4.82500000],[1642885742000,-4.72500000],[1642885984000,-4.56000000],[1642886341000,-4.36666667],[1642886644000,-4.37500000],[1642886941000,-4.05000000],[1642887183000,-4.05000000],[1642887481000,-4.35000000],[1642887782000,-4.50000000],[1642888141000,-4.16666667],[1642888381000,-4.40000000],[1642888682000,-4.47500000],[1642888982000,-4.42500000],[1642889281000,-3.76666667],[1642889583000,-4.90000000],[1642889881000,-4.87500000],[1642890244000,-4.60000000],[1642890481000,-4.32500000],[1642890784000,-3.80000000],[1642891081000,-3.77500000],[1642891383000,-3.70000000],[1642891684000,-2.56000000],[1642891983000,-2.75000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [], 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); }); $('.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; }