var graphs = {}; $(document).ready(function() { dataset = [ { label: 'Teplota (°C)', data: [[1776463218000,14.36666667],[1776463410000,14.30000000],[1776463657000,14.16000000],[1776463967000,14.06000000],[1776464290000,14.00000000],[1776464610000,14.00000000],[1776464866000,13.88000000],[1776465186000,13.78000000],[1776465504000,13.67500000],[1776465755000,13.56000000],[1776466082000,13.36000000],[1776466402000,13.10000000],[1776466654000,13.00000000],[1776466959000,12.76000000],[1776467282000,12.64000000],[1776467602000,12.50000000],[1776467854000,12.48000000],[1776468178000,12.32000000],[1776468498000,12.00000000],[1776468754000,11.52000000],[1776469074000,11.06000000],[1776469395000,10.72500000],[1776469651000,10.46000000],[1776469967000,10.02000000],[1776470290000,9.50000000],[1776470610000,9.12500000],[1776470863000,8.94000000],[1776471186000,8.66000000],[1776471503000,8.30000000],[1776471759000,8.04000000],[1776472082000,7.74000000],[1776472403000,7.50000000],[1776472654000,7.52000000],[1776472977000,7.54000000],[1776473298000,7.35000000],], color: '#d6212a' }, { label: 'Rosný bod (°C)', data: [[1776463218000,4.8],[1776463410000,4.8],[1776463657000,4.7],[1776463967000,4.7],[1776464290000,4.8],[1776464610000,4.8],[1776464866000,4.8],[1776465186000,4.7],[1776465504000,4.7],[1776465755000,4.6],[1776466082000,4.7],[1776466402000,4.7],[1776466654000,4.7],[1776466959000,4.6],[1776467282000,4.5],[1776467602000,4.4],[1776467854000,4.6],[1776468178000,4.6],[1776468498000,4.7],[1776468754000,4.5],[1776469074000,4.5],[1776469395000,4.4],[1776469651000,4.4],[1776469967000,4.4],[1776470290000,4.3],[1776470610000,4.2],[1776470863000,4.2],[1776471186000,4.2],[1776471503000,4.1],[1776471759000,4],[1776472082000,4],[1776472403000,4],[1776472654000,4],[1776472977000,4],[1776473298000,3.9],], 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: [[1776463218000,53.00000000],[1776463410000,53.00000000],[1776463657000,53.20000000],[1776463967000,53.60000000],[1776464290000,54.00000000],[1776464610000,54.00000000],[1776464866000,54.40000000],[1776465186000,54.60000000],[1776465504000,55.00000000],[1776465755000,55.00000000],[1776466082000,56.20000000],[1776466402000,57.00000000],[1776466654000,57.20000000],[1776466959000,58.00000000],[1776467282000,58.00000000],[1776467602000,58.25000000],[1776467854000,58.80000000],[1776468178000,59.40000000],[1776468498000,61.25000000],[1776468754000,62.40000000],[1776469074000,64.20000000],[1776469395000,65.25000000],[1776469651000,66.40000000],[1776469967000,68.40000000],[1776470290000,70.20000000],[1776470610000,71.50000000],[1776470863000,72.20000000],[1776471186000,73.60000000],[1776471503000,75.00000000],[1776471759000,76.00000000],[1776472082000,77.20000000],[1776472403000,78.50000000],[1776472654000,78.40000000],[1776472977000,78.40000000],[1776473298000,79.00000000],], 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); }); $(document).ready(function() { dataset = [ { label: 'Atmosférický tlak (hPa)', data: [[1776463218000,1019.6],[1776463410000,1019.5],[1776463657000,1019.6],[1776463967000,1019.6],[1776464290000,1019.7],[1776464610000,1019.7],[1776464866000,1019.8],[1776465186000,1019.7],[1776465504000,1019.8],[1776465755000,1019.7],[1776466082000,1019.8],[1776466402000,1019.7],[1776466654000,1019.8],[1776466959000,1019.9],[1776467282000,1019.8],[1776467602000,1019.9],[1776467854000,1019.9],[1776468178000,1019.9],[1776468498000,1020],[1776468754000,1020],[1776469074000,1020],[1776469395000,1020],[1776469651000,1020],[1776469967000,1020],[1776470290000,1019.9],[1776470610000,1020],[1776470863000,1020],[1776471186000,1020],[1776471503000,1020.1],[1776471759000,1020.2],[1776472082000,1020.3],[1776472403000,1020.3],[1776472654000,1020.3],[1776472977000,1020.2],[1776473298000,1020.4],], color: '#000000' } ]; var options = { xaxes: [{ axisLabel: 'pressure', }], 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.1hPa' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-pressure-legend' } }; graphs['#chart-pressure'] = $.plot('#chart-pressure', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Rýchlosť vetra (km/h)', data: [[1776463218000,2.400000012],[1776463410000,3.51],[1776463657000,3.24],[1776463967000,2.232],[1776464290000,2.592],[1776464610000,3.69],[1776464866000,3.168],[1776465186000,3.672],[1776465504000,3.69],[1776465755000,3.672],[1776466082000,2.736],[1776466402000,1.71],[1776466654000,1.728],[1776466959000,1.872],[1776467282000,2.16],[1776467602000,1.62],[1776467854000,1.296],[1776468178000,0.864],[1776468498000,0.36],[1776468754000,1.008],[1776469074000,0.072],[1776469395000,0.72],[1776469651000,0.36],[1776469967000,0],[1776470290000,0],[1776470610000,0],[1776470863000,0],[1776471186000,0],[1776471503000,0],[1776471759000,0],[1776472082000,0],[1776472403000,0],[1776472654000,0],[1776472977000,0],[1776473298000,0],], color: '#002f80', points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, }, { label: 'Náraz vetra (km/h)', data: [[1776463218000,4.200000012],[1776463410000,5.67],[1776463657000,5.04],[1776463967000,4.032],[1776464290000,4.032],[1776464610000,6.3],[1776464866000,5.04],[1776465186000,5.544],[1776465504000,6.93],[1776465755000,5.04],[1776466082000,5.544],[1776466402000,1.89],[1776466654000,3.528],[1776466959000,3.024],[1776467282000,4.032],[1776467602000,2.52],[1776467854000,2.016],[1776468178000,2.016],[1776468498000,0.63],[1776468754000,2.016],[1776469074000,0.504],[1776469395000,1.89],[1776469651000,1.008],[1776469967000,0],[1776470290000,0],[1776470610000,0],[1776470863000,0],[1776471186000,0],[1776471503000,0],[1776471759000,0],[1776472082000,0],[1776472403000,0],[1776472654000,0],[1776472977000,0],[1776473298000,0],], color: '#EF9856', points: { show: true }, lines: { show: false }, } ]; var options = { xaxes: [{ axisLabel: 'wind', }], 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.1km/h' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-wind-legend' } }; graphs['#chart-wind'] = $.plot('#chart-wind', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Smer vetra', data: [[1776463218000,127.66666667],[1776463410000,258.00000000],[1776463657000,164.40000000],[1776463967000,123.80000000],[1776464290000,166.00000000],[1776464610000,75.00000000],[1776464866000,136.40000000],[1776465186000,202.40000000],[1776465504000,260.50000000],[1776465755000,188.40000000],[1776466082000,93.40000000],[1776466402000,123.25000000],[1776466654000,154.40000000],[1776466959000,52.00000000],[1776467282000,118.20000000],[1776467602000,126.75000000],[1776467854000,67.40000000],[1776468178000,135.40000000],[1776468498000,86.50000000],[1776468754000,69.60000000],[1776469074000,87.40000000],[1776469395000,129.50000000],[1776469651000,90.60000000],[1776469967000,98.40000000],[1776470290000,100.00000000],[1776470610000,100.50000000],[1776470863000,96.00000000],[1776471186000,99.00000000],[1776471503000,92.50000000],[1776471759000,92.80000000],[1776472082000,94.00000000],[1776472403000,93.00000000],[1776472654000,91.40000000],[1776472977000,97.00000000],[1776473298000,99.50000000],], color: '#002f80', points: { show: true }, lines: { show: false }, } ]; var options = { xaxes: [{ axisLabel: 'wind_direction', }], xaxis: { mode: 'time', minTickSize: [1, 'hour'], timeformat: '%d.%m.\, %H:%M', timezone: 'browser', }, yaxis: { min: 0, max: 360, ticks: [[0, 'S'], [90, 'V'], [180, 'J'], [270, 'Z'], [360, 'S']] }, grid: { hoverable: true, clickable: true, borderWidth: 0, }, tooltip: { show: true, content: function(label, xval, yval, flotItem) { dir = meteo_wind_direction_name(yval); format_date = moment(xval).format('DD.MM., hh:mm') return format_date+' - '+dir; } }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-wind-direction-legend' } }; graphs['#chart-wind-direction'] = $.plot('#chart-wind-direction', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Slnečné žiarenie (W/m2)', data: [[1776463218000,0.00000000],[1776463410000,0.00000000],[1776463657000,0.00000000],[1776463967000,0.00000000],[1776464290000,0.00000000],[1776464610000,0.00000000],[1776464866000,0.00000000],[1776465186000,0.00000000],[1776465504000,0.00000000],[1776465755000,0.00000000],[1776466082000,0.00000000],[1776466402000,0.00000000],[1776466654000,0.00000000],[1776466959000,0.00000000],[1776467282000,0.00000000],[1776467602000,0.00000000],[1776467854000,0.00000000],[1776468178000,0.00000000],[1776468498000,0.00000000],[1776468754000,0.00000000],[1776469074000,0.00000000],[1776469395000,0.00000000],[1776469651000,0.00000000],[1776469967000,0.00000000],[1776470290000,0.00000000],[1776470610000,0.00000000],[1776470863000,0.00000000],[1776471186000,0.00000000],[1776471503000,0.00000000],[1776471759000,0.00000000],[1776472082000,0.00000000],[1776472403000,0.00000000],[1776472654000,0.00000000],[1776472977000,0.00000000],[1776473298000,0.00000000],], color: '#ffb92f' } ]; var options = { xaxes: [{ axisLabel: 'solar_radiation', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, yaxis: { min: 0, }, 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.1W/m2' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-solar-radiation-legend' } }; graphs['#chart-solar-radiation'] = $.plot('#chart-solar-radiation', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'UV žiarenie', data: [[1776463218000,0.00000000],[1776463410000,0.00000000],[1776463657000,0.00000000],[1776463967000,0.00000000],[1776464290000,0.00000000],[1776464610000,0.00000000],[1776464866000,0.00000000],[1776465186000,0.00000000],[1776465504000,0.00000000],[1776465755000,0.00000000],[1776466082000,0.00000000],[1776466402000,0.00000000],[1776466654000,0.00000000],[1776466959000,0.00000000],[1776467282000,0.00000000],[1776467602000,0.00000000],[1776467854000,0.00000000],[1776468178000,0.00000000],[1776468498000,0.00000000],[1776468754000,0.00000000],[1776469074000,0.00000000],[1776469395000,0.00000000],[1776469651000,0.00000000],[1776469967000,0.00000000],[1776470290000,0.00000000],[1776470610000,0.00000000],[1776470863000,0.00000000],[1776471186000,0.00000000],[1776471503000,0.00000000],[1776471759000,0.00000000],[1776472082000,0.00000000],[1776472403000,0.00000000],[1776472654000,0.00000000],[1776472977000,0.00000000],[1776473298000,0.00000000],], color: '#802674' } ]; var options = { xaxes: [{ axisLabel: 'uv', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, yaxis: { min: 0, }, 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.0' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-uv-legend' } }; graphs['#chart-uv'] = $.plot('#chart-uv', dataset, options); }); $(document).ready(function() { dataset = [ { label: 'Zrážky', data: [[1776463218000,0.00000000],[1776463410000,0.00000000],[1776463657000,0.00000000],[1776463967000,0.00000000],[1776464290000,0.00000000],[1776464610000,0.00000000],[1776464866000,0.00000000],[1776465186000,0.00000000],[1776465504000,0.00000000],[1776465755000,0.00000000],[1776466082000,0.00000000],[1776466402000,0.00000000],[1776466654000,0.00000000],[1776466959000,0.00000000],[1776467282000,0.00000000],[1776467602000,0.00000000],[1776467854000,0.00000000],[1776468178000,0.00000000],[1776468498000,0.00000000],[1776468754000,0.00000000],[1776469074000,0.00000000],[1776469395000,0.00000000],[1776469651000,0.00000000],[1776469967000,0.00000000],[1776470290000,0.00000000],[1776470610000,0.00000000],[1776470863000,0.00000000],[1776471186000,0.00000000],[1776471503000,0.00000000],[1776471759000,0.00000000],[1776472082000,0.00000000],[1776472403000,0.00000000],[1776472654000,0.00000000],[1776472977000,0.00000000],[1776473298000,0.00000000],], color: '#008fbf' } ]; var options = { xaxes: [{ axisLabel: 'rain', }], points: { show: false }, lines: { show: true, lineWidth: 2, fill: false, }, yaxis: { min: 0, }, 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.3mm' }, crosshair: { mode: 'x' }, legend: { show: true, container: '#chart-rain-legend' } }; graphs['#chart-rain'] = $.plot('#chart-rain', 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; }