var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [], 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); }); $(document).ready(function() { dataset = [ { label: 'Vlhkosť (%)', data: [[1568498402000,60.46666667],[1568498581000,60.92000000],[1568498881000,60.86000000],[1568499181000,62.74000000],[1568499481000,62.76000000],[1568499782000,62.60000000],[1568500081000,62.42000000],[1568500381000,61.18000000],[1568500681000,61.98000000],[1568500981000,63.66000000],[1568501281000,64.26000000],[1568501581000,64.28000000],[1568501881000,64.50000000],[1568502181000,64.10000000],[1568502482000,64.28000000],[1568502781000,64.84000000],[1568503082000,64.84000000],[1568503381000,65.04000000],[1568503681000,65.36000000],[1568503981000,65.08000000],[1568504281000,66.00000000],[1568504582000,65.72000000],[1568504881000,66.68000000],[1568505181000,64.64000000],[1568505481000,65.72000000],[1568505781000,65.96000000],[1568506081000,65.52000000],[1568506381000,66.48000000],[1568506681000,66.58000000],[1568506981000,67.32000000],[1568507282000,67.54000000],[1568507581000,67.16000000],[1568507881000,67.76000000],[1568508181000,68.14000000],[1568508481000,69.72000000],[1568508781000,70.96000000],[1568509081000,70.60000000],[1568509381000,72.56000000],[1568509681000,72.02000000],[1568509981000,72.22000000],[1568510281000,72.66000000],[1568510582000,70.80000000],[1568510881000,70.18000000],[1568511181000,71.42000000],[1568511481000,72.04000000],[1568511781000,73.20000000],[1568512081000,75.44000000],[1568512381000,76.08000000],[1568512682000,75.52000000],[1568512981000,75.24000000],[1568513281000,75.96000000],[1568513581000,75.86000000],[1568513881000,76.76000000],[1568514181000,76.98000000],[1568514481000,77.50000000],[1568514781000,78.62000000],[1568515081000,79.12000000],[1568515381000,78.58000000],[1568515681000,79.54000000],[1568515981000,79.40000000],[1568516281000,80.32000000],[1568516581000,81.00000000],[1568516882000,81.84000000],[1568517181000,82.48000000],[1568517481000,82.28000000],[1568517781000,81.80000000],[1568518081000,82.08000000],[1568518381000,83.04000000],[1568518681000,83.08000000],[1568518981000,83.28000000],[1568519281000,83.24000000],[1568519581000,83.48000000],[1568519881000,83.10000000],[1568520181000,83.30000000],[1568520482000,83.24000000],[1568520781000,84.20000000],[1568521081000,82.22000000],[1568521381000,81.75000000],], 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); }); $('.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; }