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); }); $('.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; }