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: [[1570786621000,74.00000000],[1570786681000,69.64000000],[1570786981000,67.48000000],[1570787281000,69.06000000],[1570787581000,67.56000000],[1570787881000,66.92000000],[1570788181000,68.48000000],[1570788482000,66.78000000],[1570788781000,64.95000000],[1570791061000,63.80000000],[1570791181000,61.46000000],[1570791481000,59.25000000],[1570791781000,57.98000000],[1570792081000,60.24000000],[1570792381000,58.98000000],[1570792681000,57.00000000],[1570810741000,63.62500000],[1570810981000,63.46000000],[1570811281000,64.16000000],[1570811581000,65.36000000],[1570811881000,66.50000000],[1570812181000,66.64000000],[1570812481000,67.98000000],[1570812781000,68.50000000],[1570822261000,92.20000000],[1570822381000,92.44000000],[1570822681000,92.90000000],[1570824121000,94.00000000],[1570824181000,93.94000000],[1570824481000,93.50000000],[1570824782000,93.50000000],[1570825081000,92.68000000],[1570825381000,92.08000000],[1570825681000,92.32000000],[1570825981000,92.36000000],[1570826281000,92.12000000],[1570826581000,92.44000000],[1570826881000,92.50000000],[1570827181000,92.30000000],[1570827481000,91.88000000],[1570827781000,90.86000000],[1570828081000,89.98000000],[1570828381000,90.46000000],[1570828681000,90.80000000],[1570828981000,90.54000000],[1570829281000,91.26000000],[1570829581000,91.54000000],[1570829881000,91.72000000],[1570830181000,91.82000000],[1570830481000,92.25000000],], 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; }