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: [[1569016801000,68.16666667],[1569016981000,68.32000000],[1569017281000,68.78000000],[1569017581000,69.18000000],[1569017881000,70.34000000],[1569018181000,71.18000000],[1569018481000,71.00000000],[1569018781000,71.82000000],[1569019081000,71.96000000],[1569019381000,72.66000000],[1569019681000,72.92000000],[1569019981000,72.80000000],[1569020281000,72.42000000],[1569020581000,72.88000000],[1569020881000,72.32000000],[1569021181000,72.28000000],[1569021481000,71.72000000],[1569021781000,70.12000000],[1569022081000,70.18000000],[1569022381000,71.10000000],[1569022681000,70.16000000],[1569022981000,69.12000000],[1569023281000,70.06000000],[1569023581000,69.30000000],[1569023881000,69.72000000],[1569024181000,69.82000000],[1569024481000,68.66000000],[1569024781000,70.44000000],[1569025081000,70.28000000],[1569025381000,71.72000000],[1569025681000,70.82000000],[1569025981000,70.04000000],[1569026282000,70.50000000],[1569026581000,71.18000000],[1569026881000,72.08000000],[1569027181000,72.60000000],[1569027481000,71.60000000],[1569027781000,71.48000000],[1569028081000,73.04000000],[1569028381000,73.58000000],[1569028681000,74.06000000],[1569028981000,75.16000000],[1569029281000,74.12000000],[1569029581000,74.58000000],[1569029881000,75.12000000],[1569030181000,75.94000000],[1569030481000,75.76000000],[1569030781000,75.56000000],[1569031081000,77.34000000],[1569031381000,78.06000000],[1569031681000,79.02000000],[1569031981000,78.12000000],[1569032281000,76.80000000],[1569032581000,76.38000000],[1569032881000,75.32000000],[1569033182000,75.88000000],[1569033481000,75.64000000],[1569033782000,74.78000000],[1569034081000,75.40000000],[1569034382000,74.80000000],[1569034681000,75.78000000],[1569034981000,76.04000000],[1569035281000,76.98000000],[1569035581000,76.94000000],[1569035881000,76.92000000],[1569036181000,77.10000000],[1569036481000,77.54000000],[1569036782000,77.94000000],[1569037081000,78.04000000],[1569037381000,76.32000000],[1569037681000,75.92000000],[1569037981000,76.50000000],[1569038281000,76.04000000],[1569038581000,75.66000000],[1569038881000,75.06000000],[1569039181000,73.40000000],[1569039481000,73.42000000],[1569039781000,72.38000000],[1569040081000,71.62000000],[1569040381000,70.90000000],[1569040682000,71.18000000],[1569040981000,72.42000000],[1569041281000,71.70000000],[1569041581000,70.44000000],[1569041881000,71.58000000],[1569042181000,70.60000000],[1569042482000,71.84000000],[1569042781000,70.74000000],[1569043081000,70.74000000],[1569043381000,70.74000000],[1569043681000,71.46000000],[1569043981000,70.86000000],[1569044281000,70.82000000],[1569044581000,68.94000000],[1569044881000,69.24000000],[1569045181000,69.26000000],[1569045481000,69.64000000],[1569045781000,70.02000000],[1569046081000,68.88000000],[1569046381000,70.00000000],[1569046681000,69.68000000],[1569046981000,69.06000000],[1569047281000,69.16000000],[1569047582000,68.86000000],[1569047881000,68.38000000],[1569048181000,68.52000000],[1569048481000,68.70000000],[1569048781000,68.32000000],[1569049081000,67.70000000],[1569049381000,67.18000000],[1569049681000,67.54000000],[1569049981000,65.42000000],[1569050281000,64.16000000],[1569050581000,64.88000000],[1569050881000,64.20000000],[1569051181000,63.38000000],[1569051481000,62.94000000],[1569051781000,64.64000000],[1569052081000,62.56000000],], 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; }