var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1579820402000,-4.03333333],[1579820581000,-4.10000000],[1579820881000,-4.40000000],[1579821181000,-4.46000000],[1579821481000,-4.34000000],[1579821782000,-4.20000000],[1579822081000,-4.26000000],[1579822381000,-4.20000000],[1579822681000,-4.26000000],[1579822982000,-4.22000000],[1579823281000,-4.12000000],[1579823581000,-4.26000000],[1579823881000,-4.38000000],[1579824182000,-4.62000000],[1579824481000,-4.44000000],[1579824781000,-4.52000000],[1579825081000,-4.66000000],[1579825381000,-4.86000000],[1579825681000,-5.00000000],[1579825982000,-5.14000000],[1579826281000,-5.24000000],[1579826581000,-5.52000000],[1579826881000,-5.78000000],[1579827181000,-5.80000000],[1579827481000,-4.82000000],[1579827782000,-4.96000000],[1579828082000,-5.04000000],[1579828381000,-4.86000000],[1579828681000,-4.98000000],[1579828982000,-5.28000000],[1579829282000,-5.36000000],[1579829581000,-5.18000000],[1579829881000,-5.20000000],[1579830182000,-5.10000000],[1579830481000,-5.16000000],[1579830781000,-5.04000000],[1579831082000,-4.76000000],[1579831381000,-4.38000000],[1579831681000,-5.18000000],[1579831981000,-5.32000000],[1579832282000,-5.14000000],[1579832581000,-4.80000000],[1579832881000,-4.84000000],[1579833182000,-5.10000000],[1579833481000,-4.94000000],[1579833781000,-5.04000000],[1579834081000,-5.32000000],[1579834382000,-5.56000000],[1579834681000,-5.58000000],[1579834981000,-5.58000000],[1579835282000,-5.62000000],[1579835582000,-5.66000000],[1579835881000,-5.38000000],[1579836181000,-5.28000000],[1579836482000,-5.10000000],[1579836781000,-5.12000000],[1579837081000,-5.36000000],[1579837382000,-5.62000000],[1579837681000,-5.66000000],[1579837981000,-5.84000000],[1579838282000,-6.10000000],[1579838581000,-6.00000000],[1579838881000,-5.76000000],[1579839181000,-5.68000000],[1579839482000,-5.46000000],[1579839781000,-5.52000000],[1579840081000,-5.50000000],[1579840381000,-5.52000000],[1579840681000,-5.38000000],[1579840981000,-5.54000000],[1579841281000,-5.70000000],[1579841582000,-5.90000000],[1579841881000,-6.02000000],[1579842181000,-5.82000000],[1579842482000,-5.70000000],[1579842781000,-4.74000000],[1579843081000,-4.44000000],[1579843382000,-3.86000000],[1579843681000,-3.50000000],[1579843981000,-3.24000000],[1579844282000,-3.22000000],[1579844581000,-3.16000000],[1579844881000,-2.90000000],[1579845181000,-2.80000000],[1579845482000,-2.84000000],[1579845781000,-3.20000000],[1579846081000,-3.16000000],[1579846381000,-3.14000000],[1579846681000,-3.12000000],[1579846981000,-3.22000000],[1579847282000,-3.30000000],[1579847582000,-3.24000000],[1579847881000,-3.08000000],[1579848181000,-3.02000000],[1579848482000,-2.98000000],[1579848781000,-2.88000000],[1579849081000,-2.86000000],[1579849381000,-2.88000000],[1579849682000,-2.90000000],[1579849981000,-2.76000000],[1579850281000,-2.64000000],[1579850582000,-2.50000000],[1579850881000,-2.42000000],[1579851181000,-2.28000000],[1579851482000,-2.16000000],[1579851781000,-1.98000000],[1579852081000,-2.06000000],[1579852382000,-2.16000000],[1579852682000,-1.78000000],[1579852981000,-1.94000000],[1579853282000,-1.68000000],[1579853581000,-1.18000000],[1579853881000,-0.90000000],[1579854181000,-0.84000000],[1579854481000,-0.94000000],[1579854781000,-0.72000000],[1579855082000,-0.44000000],[1579855381000,-0.40000000],[1579855681000,-0.34000000],[1579855982000,-0.18000000],[1579856282000,-0.12000000],[1579856581000,-0.18000000],[1579856881000,-0.12000000],[1579857182000,0.08000000],[1579857481000,0.24000000],[1579857781000,0.14000000],[1579858082000,0.22000000],[1579858381000,0.40000000],[1579858681000,0.54000000],[1579858981000,0.46000000],[1579859281000,0.52000000],[1579859581000,0.56000000],[1579859881000,0.52000000],[1579860181000,0.76000000],[1579860481000,0.84000000],[1579860781000,0.82000000],[1579861081000,1.14000000],[1579861381000,1.16000000],[1579861681000,1.16000000],[1579861981000,1.22000000],[1579862281000,1.32000000],[1579862582000,1.42000000],[1579862882000,1.42000000],[1579863181000,1.38000000],[1579863482000,1.38000000],[1579863782000,1.52000000],[1579864081000,1.52000000],[1579864381000,1.64000000],[1579864681000,1.70000000],[1579864981000,1.74000000],[1579865281000,1.74000000],[1579865581000,1.90000000],[1579865881000,2.08000000],[1579866181000,2.26000000],[1579866481000,2.34000000],[1579866781000,2.14000000],[1579867082000,2.32000000],[1579867381000,2.30000000],[1579867681000,2.36000000],[1579867982000,2.38000000],[1579868281000,2.80000000],[1579868581000,2.82000000],[1579868881000,2.84000000],[1579869182000,2.68000000],[1579869481000,2.60000000],[1579869781000,2.58000000],[1579870081000,2.78000000],[1579870382000,2.82000000],[1579870682000,2.68000000],[1579870981000,2.80000000],[1579871281000,2.86000000],[1579871581000,2.96000000],[1579871882000,2.56000000],[1579872182000,2.76000000],[1579872481000,3.24000000],[1579872851000,3.10000000],[1579873092000,3.28000000],[1579873382000,3.14000000],[1579873725000,2.88000000],[1579873981000,2.92000000],[1579874281000,2.22500000],[1579874622000,2.10000000],[1579874868000,2.34000000],[1579875208000,2.03333333],[1579875481000,1.72000000],[1579875841000,1.80000000],[1579876081000,1.60000000],[1579876381000,1.34000000],[1579876682000,1.04000000],[1579876981000,0.98000000],[1579877281000,0.56000000],[1579877581000,0.40000000],[1579877882000,0.00000000],[1579878181000,-0.30000000],[1579878481000,-0.48000000],[1579878782000,-0.70000000],[1579879081000,-0.86000000],[1579879381000,-1.06000000],[1579879681000,-1.26000000],[1579879981000,-1.36000000],[1579880281000,-1.50000000],[1579880582000,-1.68000000],[1579880881000,-1.88000000],[1579881181000,-2.02000000],[1579881481000,-2.10000000],[1579881782000,-2.16000000],[1579882081000,-2.26000000],[1579882381000,-2.30000000],[1579882681000,-2.36000000],[1579882982000,-2.38000000],[1579883281000,-2.48000000],[1579883581000,-2.56000000],[1579883881000,-2.70000000],[1579884182000,-2.78000000],[1579884481000,-2.82000000],[1579884781000,-2.96000000],[1579885082000,-3.04000000],[1579885381000,-3.02000000],[1579885681000,-2.98000000],[1579885982000,-3.04000000],[1579886281000,-3.04000000],[1579886582000,-3.14000000],[1579886882000,-3.20000000],[1579887181000,-3.20000000],[1579887481000,-3.32000000],[1579887782000,-3.20000000],[1579888081000,-3.28000000],[1579888381000,-3.20000000],[1579888681000,-3.16000000],[1579888982000,-3.22000000],[1579889282000,-3.22000000],[1579889581000,-3.34000000],[1579889881000,-3.74000000],[1579890181000,-3.60000000],[1579890482000,-3.60000000],[1579890782000,-3.60000000],[1579891081000,-3.60000000],[1579891381000,-3.60000000],[1579891682000,-3.60000000],[1579891981000,-3.58000000],[1579892281000,-3.58000000],[1579892582000,-3.60000000],[1579892881000,-3.48000000],[1579893181000,-3.44000000],[1579893482000,-3.42000000],[1579893781000,-3.36000000],[1579894081000,-3.30000000],[1579894382000,-3.22000000],[1579894681000,-3.16000000],[1579894981000,-3.18000000],[1579895282000,-3.10000000],[1579895581000,-3.10000000],[1579895881000,-3.10000000],[1579896182000,-3.10000000],[1579896481000,-3.06000000],[1579896781000,-3.02000000],[1579897081000,-3.10000000],[1579897382000,-3.10000000],[1579897681000,-3.06000000],[1579897981000,-3.10000000],[1579898281000,-3.16000000],[1579898581000,-3.10000000],[1579898881000,-3.18000000],[1579899181000,-3.18000000],[1579899481000,-3.18000000],[1579899781000,-3.22000000],[1579900082000,-3.22000000],[1579900381000,-3.26000000],[1579900681000,-3.26000000],[1579900981000,-3.20000000],[1579901282000,-3.20000000],[1579901581000,-3.24000000],[1579901881000,-3.20000000],[1579902182000,-3.22000000],[1579902482000,-3.20000000],[1579902781000,-3.14000000],[1579903081000,-3.16000000],[1579903382000,-3.14000000],[1579903682000,-3.16000000],[1579903981000,-3.20000000],[1579904281000,-3.20000000],[1579904582000,-3.20000000],[1579904881000,-3.18000000],[1579905181000,-3.18000000],[1579905481000,-3.10000000],[1579905782000,-3.12000000],[1579906081000,-3.16000000],[1579906382000,-3.10000000],[1579906682000,-3.10000000],], 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; }