var meteoCharts = {}; var meteoCompassLabels = {0: 'S', 90: 'V', 180: 'J', 270: 'Z', 360: 'S'}; var meteoRangeMin = 1795388400000; var meteoRangeMax = 1795403385000; function meteoFormatTime(ms) { return moment(ms).format('HH:mm'); } function meteoFormatDateTime(ms) { return moment(ms).format('DD.MM., HH:mm'); } function meteoComputeExtremes(points) { var minPoint = null, maxPoint = null; for (var i = 0; i < points.length; i++) { var p = points[i]; if (p.y === null || p.y === undefined) continue; if (!minPoint || p.y < minPoint.y) minPoint = p; if (!maxPoint || p.y > maxPoint.y) maxPoint = p; } return (minPoint || maxPoint) ? {min: minPoint, max: maxPoint} : null; } function meteoExtremeType(extremes, p) { if (!extremes || !p) return null; if (extremes.max && p.x === extremes.max.x && p.y === extremes.max.y) return 'max'; if (extremes.min && p.x === extremes.min.x && p.y === extremes.min.y) return 'min'; return null; } function meteoBuildDataset(spec) { var extremes = spec.highlightExtremes ? meteoComputeExtremes(spec.points) : null; var baseRadius = spec.pointRadius !== undefined ? spec.pointRadius : 0; var baseHoverRadius = baseRadius || 3; return { label: spec.label, data: spec.points, borderColor: spec.color, backgroundColor: spec.color, borderWidth: 2, tension: 0.15, fill: false, spanGaps: true, showLine: spec.showLine !== false, meteoUnit: spec.unit || '', meteoTooltipMode: spec.tooltipMode || 'default', meteoExtremes: extremes, pointRadius: function(context) { return meteoExtremeType(extremes, context.raw) ? Math.max(baseRadius, 5) : baseRadius; }, pointHoverRadius: function(context) { return meteoExtremeType(extremes, context.raw) ? Math.max(baseHoverRadius, 7) : baseHoverRadius; }, pointBackgroundColor: spec.color, pointBorderColor: '#ffffff', pointBorderWidth: function(context) { return meteoExtremeType(extremes, context.raw) ? 2 : 0; } }; } function buildMeteoChart(canvasId, resetButtonId, specs, extraOptions) { var canvas = document.getElementById(canvasId); if (!canvas || typeof Chart === 'undefined' || !specs.length) { return; } extraOptions = extraOptions || {}; var yScale = {title: {display: !!extraOptions.yLabel, text: extraOptions.yLabel || ''}}; if (extraOptions.yMin !== undefined) yScale.min = extraOptions.yMin; if (extraOptions.yMax !== undefined) yScale.max = extraOptions.yMax; if (extraOptions.yMode === 'compass') { yScale.min = 0; yScale.max = 360; yScale.ticks = { stepSize: 90, callback: function(value) { return meteoCompassLabels[value] !== undefined ? meteoCompassLabels[value] : value; } }; } meteoCharts[canvasId] = new Chart(canvas.getContext('2d'), { type: 'line', data: {datasets: specs.map(meteoBuildDataset)}, options: { responsive: true, maintainAspectRatio: false, animation: false, interaction: {mode: 'nearest', axis: 'x', intersect: false}, scales: { x: { type: 'linear', min: meteoRangeMin, max: meteoRangeMax, ticks: {maxTicksLimit: 8, callback: meteoFormatTime} }, y: yScale }, plugins: { legend: {display: true, position: 'top'}, tooltip: { callbacks: { title: function(items) { return items.length ? meteoFormatDateTime(items[0].parsed.x) : ''; }, label: function(context) { var ds = context.dataset; if (ds.meteoTooltipMode === 'windDirection') { return meteo_wind_direction_name(context.parsed.y); } var extremeType = meteoExtremeType(ds.meteoExtremes, context.raw); var suffix = extremeType === 'max' ? ' (dnešné maximum)' : (extremeType === 'min' ? ' (dnešné minimum)' : ''); return ds.label + ': ' + context.parsed.y + ds.meteoUnit + suffix; } } }, zoom: { pan: {enabled: true, mode: 'x'}, zoom: {wheel: {enabled: true}, pinch: {enabled: true}, mode: 'x'}, limits: {x: {min: meteoRangeMin, max: meteoRangeMax}} } } } }); var resetButton = document.getElementById(resetButtonId); if (resetButton) { resetButton.addEventListener('click', function() { meteoCharts[canvasId].resetZoom(); }); } } $(document).ready(function() { buildMeteoChart('chart-temperature-canvas', 'chart-temperature-reset', [{"label":"Teplota (°C)","color":"#d6212a","points":[{"x":1795388431000,"y":3},{"x":1795388493000,"y":3},{"x":1795388555000,"y":3},{"x":1795388617000,"y":3.1},{"x":1795388679000,"y":3.1},{"x":1795388741000,"y":3.1},{"x":1795388803000,"y":3.1},{"x":1795388866000,"y":3.1},{"x":1795388927000,"y":3.1},{"x":1795388990000,"y":3.1},{"x":1795389053000,"y":3},{"x":1795389115000,"y":2.9},{"x":1795389178000,"y":2.9},{"x":1795389243000,"y":2.8},{"x":1795389310000,"y":2.8},{"x":1795389372000,"y":2.7},{"x":1795389435000,"y":2.6},{"x":1795389501000,"y":2.6},{"x":1795389564000,"y":2.6},{"x":1795389626000,"y":2.6},{"x":1795389687000,"y":2.6},{"x":1795389749000,"y":2.5},{"x":1795389811000,"y":2.5},{"x":1795389873000,"y":2.6},{"x":1795389935000,"y":2.6},{"x":1795389997000,"y":2.5},{"x":1795390059000,"y":2.5},{"x":1795390120000,"y":2.5},{"x":1795390182000,"y":2.4},{"x":1795390244000,"y":2.4},{"x":1795390306000,"y":2.3},{"x":1795390368000,"y":2.3},{"x":1795390429000,"y":2.3},{"x":1795390491000,"y":2.3},{"x":1795390553000,"y":2.3},{"x":1795390615000,"y":2.3},{"x":1795390677000,"y":2.4},{"x":1795390739000,"y":2.4},{"x":1795390800000,"y":2.4},{"x":1795390862000,"y":2.4},{"x":1795390924000,"y":2.3},{"x":1795390986000,"y":2.3},{"x":1795391048000,"y":2.2},{"x":1795391109000,"y":2.2},{"x":1795391171000,"y":2.3},{"x":1795391233000,"y":2.3},{"x":1795391295000,"y":2.3},{"x":1795391357000,"y":2.3},{"x":1795391419000,"y":2.3},{"x":1795391480000,"y":2.3},{"x":1795391542000,"y":2.3},{"x":1795391605000,"y":2.4},{"x":1795391666000,"y":2.4},{"x":1795391728000,"y":2.4},{"x":1795391789000,"y":2.4},{"x":1795391851000,"y":2.4},{"x":1795391918000,"y":2.4},{"x":1795391979000,"y":2.4},{"x":1795392042000,"y":2.3},{"x":1795392104000,"y":2.3},{"x":1795392165000,"y":2.3},{"x":1795392227000,"y":2.3},{"x":1795392289000,"y":2.3},{"x":1795392351000,"y":2.3},{"x":1795392413000,"y":2.2},{"x":1795392475000,"y":2.2},{"x":1795392537000,"y":2.2},{"x":1795392598000,"y":2.2},{"x":1795392660000,"y":2.2},{"x":1795392723000,"y":2.2},{"x":1795392785000,"y":2.3},{"x":1795392846000,"y":2.3},{"x":1795392908000,"y":2.3},{"x":1795392970000,"y":2.3},{"x":1795393032000,"y":2.3},{"x":1795393095000,"y":2.2},{"x":1795393156000,"y":2.2},{"x":1795393218000,"y":2.2},{"x":1795393280000,"y":2.1},{"x":1795393341000,"y":2.1},{"x":1795393404000,"y":2.1},{"x":1795393466000,"y":2.1},{"x":1795393527000,"y":2.1},{"x":1795393589000,"y":2.1},{"x":1795393651000,"y":2.1},{"x":1795393713000,"y":2.1},{"x":1795393775000,"y":2.1},{"x":1795393836000,"y":2.1},{"x":1795393898000,"y":2.1},{"x":1795393960000,"y":2.1},{"x":1795394022000,"y":2.1},{"x":1795394084000,"y":2.1},{"x":1795394146000,"y":2.1},{"x":1795394207000,"y":2.1},{"x":1795394270000,"y":2.2},{"x":1795394331000,"y":2.2},{"x":1795394394000,"y":2.2},{"x":1795394455000,"y":2.2},{"x":1795394517000,"y":2.2},{"x":1795394579000,"y":2.2},{"x":1795394640000,"y":2.2},{"x":1795394703000,"y":2.2},{"x":1795394765000,"y":2.2},{"x":1795394827000,"y":2.2},{"x":1795394889000,"y":2.2},{"x":1795394950000,"y":2.2},{"x":1795395012000,"y":2.3},{"x":1795395074000,"y":2.3},{"x":1795395136000,"y":2.2},{"x":1795395197000,"y":2.3},{"x":1795395259000,"y":2.2},{"x":1795395321000,"y":2.2},{"x":1795395382000,"y":2.3},{"x":1795395445000,"y":2.3},{"x":1795395506000,"y":2.3},{"x":1795395568000,"y":2.3},{"x":1795395630000,"y":2.3},{"x":1795395691000,"y":2.3},{"x":1795395754000,"y":2.3},{"x":1795395815000,"y":2.3},{"x":1795395877000,"y":2.3},{"x":1795395939000,"y":2.3},{"x":1795396000000,"y":2.3},{"x":1795396062000,"y":2.2},{"x":1795396124000,"y":2.2},{"x":1795396186000,"y":2.2},{"x":1795396248000,"y":2.2},{"x":1795396310000,"y":2.2},{"x":1795396372000,"y":2.2},{"x":1795396434000,"y":2.2},{"x":1795396495000,"y":2.2},{"x":1795396557000,"y":2.2},{"x":1795396619000,"y":2.2},{"x":1795396680000,"y":2.2},{"x":1795396743000,"y":2.1},{"x":1795396805000,"y":2.1},{"x":1795396866000,"y":2.1},{"x":1795396928000,"y":2.1},{"x":1795396990000,"y":2.1},{"x":1795397052000,"y":2.1},{"x":1795397114000,"y":2},{"x":1795397176000,"y":2},{"x":1795397238000,"y":2},{"x":1795397300000,"y":2},{"x":1795397361000,"y":2},{"x":1795397424000,"y":2},{"x":1795397486000,"y":2},{"x":1795397548000,"y":2},{"x":1795397609000,"y":2},{"x":1795397671000,"y":2},{"x":1795397733000,"y":2},{"x":1795397795000,"y":2},{"x":1795397857000,"y":2},{"x":1795397918000,"y":1.9},{"x":1795397980000,"y":1.9},{"x":1795398042000,"y":1.9},{"x":1795398104000,"y":1.9},{"x":1795398167000,"y":1.9},{"x":1795398228000,"y":1.9},{"x":1795398290000,"y":1.9},{"x":1795398351000,"y":1.9},{"x":1795398413000,"y":1.9},{"x":1795398475000,"y":1.9},{"x":1795398537000,"y":1.8},{"x":1795398599000,"y":1.8},{"x":1795398660000,"y":1.8},{"x":1795398722000,"y":1.8},{"x":1795398785000,"y":1.8},{"x":1795398846000,"y":1.7},{"x":1795398908000,"y":1.7},{"x":1795398970000,"y":1.7},{"x":1795399031000,"y":1.7},{"x":1795399093000,"y":1.8},{"x":1795399155000,"y":1.8},{"x":1795399217000,"y":1.8},{"x":1795399279000,"y":1.8},{"x":1795399340000,"y":1.8},{"x":1795399402000,"y":1.7},{"x":1795399464000,"y":1.8},{"x":1795399526000,"y":1.7},{"x":1795399588000,"y":1.7},{"x":1795399656000,"y":1.7},{"x":1795399718000,"y":1.7},{"x":1795399780000,"y":1.7},{"x":1795399842000,"y":1.7},{"x":1795399903000,"y":1.7},{"x":1795399966000,"y":1.7},{"x":1795400028000,"y":1.7},{"x":1795400089000,"y":1.7},{"x":1795400151000,"y":1.7},{"x":1795400213000,"y":1.7},{"x":1795400275000,"y":1.7},{"x":1795400337000,"y":1.7},{"x":1795400405000,"y":1.7},{"x":1795400467000,"y":1.7},{"x":1795400528000,"y":1.7},{"x":1795400590000,"y":1.7},{"x":1795400652000,"y":1.7},{"x":1795400714000,"y":1.7},{"x":1795400776000,"y":1.7},{"x":1795400837000,"y":1.7},{"x":1795400899000,"y":1.7},{"x":1795400961000,"y":1.7},{"x":1795401023000,"y":1.6},{"x":1795401085000,"y":1.7},{"x":1795401147000,"y":1.6},{"x":1795401208000,"y":1.7},{"x":1795401270000,"y":1.6},{"x":1795401332000,"y":1.7},{"x":1795401394000,"y":1.7},{"x":1795401456000,"y":1.7},{"x":1795401518000,"y":1.6},{"x":1795401579000,"y":1.7},{"x":1795401641000,"y":1.7},{"x":1795401703000,"y":1.7},{"x":1795401765000,"y":1.7},{"x":1795401827000,"y":1.7},{"x":1795401889000,"y":1.6},{"x":1795401950000,"y":1.5},{"x":1795402012000,"y":1.5},{"x":1795402074000,"y":1.6},{"x":1795402136000,"y":1.5},{"x":1795402198000,"y":1.6},{"x":1795402259000,"y":1.6},{"x":1795402321000,"y":1.6},{"x":1795402383000,"y":1.5},{"x":1795402445000,"y":1.6},{"x":1795402507000,"y":1.6},{"x":1795402569000,"y":1.6},{"x":1795402630000,"y":1.6},{"x":1795402692000,"y":1.6},{"x":1795402754000,"y":1.6},{"x":1795402816000,"y":1.6},{"x":1795402878000,"y":1.6},{"x":1795402939000,"y":1.6},{"x":1795403001000,"y":1.6},{"x":1795403063000,"y":1.6},{"x":1795403125000,"y":1.6},{"x":1795403187000,"y":1.6},{"x":1795403249000,"y":1.7},{"x":1795403310000,"y":1.7},{"x":1795403372000,"y":1.7}],"highlightExtremes":true,"unit":" °C"},{"label":"Rosný bod (°C)","color":"#5b9f4a","points":[{"x":1795388431000,"y":-1.3},{"x":1795388493000,"y":-1.4},{"x":1795388555000,"y":-1.4},{"x":1795388617000,"y":-1.3},{"x":1795388679000,"y":-1.4},{"x":1795388741000,"y":-1.4},{"x":1795388803000,"y":-1.4},{"x":1795388866000,"y":-1.4},{"x":1795388927000,"y":-1.4},{"x":1795388990000,"y":-1.4},{"x":1795389053000,"y":-1.4},{"x":1795389115000,"y":-1.4},{"x":1795389178000,"y":-1.3},{"x":1795389243000,"y":-1.3},{"x":1795389310000,"y":-1.3},{"x":1795389372000,"y":-1.3},{"x":1795389435000,"y":-1.3},{"x":1795389501000,"y":-1.2},{"x":1795389564000,"y":-1.2},{"x":1795389626000,"y":-1.2},{"x":1795389687000,"y":-1.2},{"x":1795389749000,"y":-1.3},{"x":1795389811000,"y":-1.3},{"x":1795389873000,"y":-1.2},{"x":1795389935000,"y":-1.2},{"x":1795389997000,"y":-1.3},{"x":1795390059000,"y":-1.2},{"x":1795390120000,"y":-1.2},{"x":1795390182000,"y":-1.3},{"x":1795390244000,"y":-1.2},{"x":1795390306000,"y":-1.2},{"x":1795390368000,"y":-1.2},{"x":1795390429000,"y":-1.2},{"x":1795390491000,"y":-1.2},{"x":1795390553000,"y":-1.2},{"x":1795390615000,"y":-1.3},{"x":1795390677000,"y":-1.2},{"x":1795390739000,"y":-1.2},{"x":1795390800000,"y":-1.2},{"x":1795390862000,"y":-1.2},{"x":1795390924000,"y":-1.2},{"x":1795390986000,"y":-1.2},{"x":1795391048000,"y":-1.3},{"x":1795391109000,"y":-1.3},{"x":1795391171000,"y":-1.2},{"x":1795391233000,"y":-1.2},{"x":1795391295000,"y":-1.2},{"x":1795391357000,"y":-1.2},{"x":1795391419000,"y":-1.2},{"x":1795391480000,"y":-1.2},{"x":1795391542000,"y":-1.2},{"x":1795391605000,"y":-1.1},{"x":1795391666000,"y":-1.1},{"x":1795391728000,"y":-1.1},{"x":1795391789000,"y":-1.1},{"x":1795391851000,"y":-1.1},{"x":1795391918000,"y":-1},{"x":1795391979000,"y":-1},{"x":1795392042000,"y":-1.1},{"x":1795392104000,"y":-1.1},{"x":1795392165000,"y":-1},{"x":1795392227000,"y":-1},{"x":1795392289000,"y":-1},{"x":1795392351000,"y":-1},{"x":1795392413000,"y":-1.1},{"x":1795392475000,"y":-1.1},{"x":1795392537000,"y":-1.1},{"x":1795392598000,"y":-1.1},{"x":1795392660000,"y":-1.1},{"x":1795392723000,"y":-1.1},{"x":1795392785000,"y":-1},{"x":1795392846000,"y":-1},{"x":1795392908000,"y":-1},{"x":1795392970000,"y":-1},{"x":1795393032000,"y":-1},{"x":1795393095000,"y":-1.1},{"x":1795393156000,"y":-1},{"x":1795393218000,"y":-1},{"x":1795393280000,"y":-1.1},{"x":1795393341000,"y":-1.1},{"x":1795393404000,"y":-1.1},{"x":1795393466000,"y":-1.1},{"x":1795393527000,"y":-1},{"x":1795393589000,"y":-1},{"x":1795393651000,"y":-1},{"x":1795393713000,"y":-1},{"x":1795393775000,"y":-1},{"x":1795393836000,"y":-1},{"x":1795393898000,"y":-1},{"x":1795393960000,"y":-1},{"x":1795394022000,"y":-1},{"x":1795394084000,"y":-1},{"x":1795394146000,"y":-1},{"x":1795394207000,"y":-1},{"x":1795394270000,"y":-0.9},{"x":1795394331000,"y":-0.9},{"x":1795394394000,"y":-0.9},{"x":1795394455000,"y":-0.9},{"x":1795394517000,"y":-1},{"x":1795394579000,"y":-1},{"x":1795394640000,"y":-1},{"x":1795394703000,"y":-1},{"x":1795394765000,"y":-1},{"x":1795394827000,"y":-1},{"x":1795394889000,"y":-1},{"x":1795394950000,"y":-1},{"x":1795395012000,"y":-0.9},{"x":1795395074000,"y":-0.9},{"x":1795395136000,"y":-1},{"x":1795395197000,"y":-0.9},{"x":1795395259000,"y":-1},{"x":1795395321000,"y":-1},{"x":1795395382000,"y":-0.9},{"x":1795395445000,"y":-0.9},{"x":1795395506000,"y":-1},{"x":1795395568000,"y":-1},{"x":1795395630000,"y":-1},{"x":1795395691000,"y":-1},{"x":1795395754000,"y":-1},{"x":1795395815000,"y":-1},{"x":1795395877000,"y":-1},{"x":1795395939000,"y":-1},{"x":1795396000000,"y":-1},{"x":1795396062000,"y":-1},{"x":1795396124000,"y":-1},{"x":1795396186000,"y":-1},{"x":1795396248000,"y":-1},{"x":1795396310000,"y":-1},{"x":1795396372000,"y":-1},{"x":1795396434000,"y":-1},{"x":1795396495000,"y":-1},{"x":1795396557000,"y":-1},{"x":1795396619000,"y":-0.9},{"x":1795396680000,"y":-0.9},{"x":1795396743000,"y":-1},{"x":1795396805000,"y":-1},{"x":1795396866000,"y":-1},{"x":1795396928000,"y":-0.9},{"x":1795396990000,"y":-0.9},{"x":1795397052000,"y":-0.9},{"x":1795397114000,"y":-1},{"x":1795397176000,"y":-1},{"x":1795397238000,"y":-1},{"x":1795397300000,"y":-1},{"x":1795397361000,"y":-1},{"x":1795397424000,"y":-1},{"x":1795397486000,"y":-0.9},{"x":1795397548000,"y":-0.9},{"x":1795397609000,"y":-0.9},{"x":1795397671000,"y":-0.9},{"x":1795397733000,"y":-0.9},{"x":1795397795000,"y":-0.9},{"x":1795397857000,"y":-0.9},{"x":1795397918000,"y":-1},{"x":1795397980000,"y":-0.9},{"x":1795398042000,"y":-0.9},{"x":1795398104000,"y":-0.9},{"x":1795398167000,"y":-0.9},{"x":1795398228000,"y":-0.9},{"x":1795398290000,"y":-0.9},{"x":1795398351000,"y":-0.9},{"x":1795398413000,"y":-0.9},{"x":1795398475000,"y":-0.8},{"x":1795398537000,"y":-0.9},{"x":1795398599000,"y":-0.9},{"x":1795398660000,"y":-0.9},{"x":1795398722000,"y":-0.9},{"x":1795398785000,"y":-0.8},{"x":1795398846000,"y":-0.9},{"x":1795398908000,"y":-0.9},{"x":1795398970000,"y":-0.9},{"x":1795399031000,"y":-0.9},{"x":1795399093000,"y":-0.8},{"x":1795399155000,"y":-0.9},{"x":1795399217000,"y":-0.8},{"x":1795399279000,"y":-0.9},{"x":1795399340000,"y":-0.9},{"x":1795399402000,"y":-1},{"x":1795399464000,"y":-0.9},{"x":1795399526000,"y":-1},{"x":1795399588000,"y":-1},{"x":1795399656000,"y":-1},{"x":1795399718000,"y":-1},{"x":1795399780000,"y":-1},{"x":1795399842000,"y":-1},{"x":1795399903000,"y":-1},{"x":1795399966000,"y":-1},{"x":1795400028000,"y":-1},{"x":1795400089000,"y":-1},{"x":1795400151000,"y":-1},{"x":1795400213000,"y":-1},{"x":1795400275000,"y":-1},{"x":1795400337000,"y":-1},{"x":1795400405000,"y":-1},{"x":1795400467000,"y":-1},{"x":1795400528000,"y":-1},{"x":1795400590000,"y":-1},{"x":1795400652000,"y":-1.1},{"x":1795400714000,"y":-1.1},{"x":1795400776000,"y":-1.1},{"x":1795400837000,"y":-1.1},{"x":1795400899000,"y":-1.1},{"x":1795400961000,"y":-1.1},{"x":1795401023000,"y":-1.2},{"x":1795401085000,"y":-1},{"x":1795401147000,"y":-1.1},{"x":1795401208000,"y":-1.1},{"x":1795401270000,"y":-1.2},{"x":1795401332000,"y":-1.1},{"x":1795401394000,"y":-1.1},{"x":1795401456000,"y":-1.1},{"x":1795401518000,"y":-1.2},{"x":1795401579000,"y":-1.1},{"x":1795401641000,"y":-1.1},{"x":1795401703000,"y":-1.1},{"x":1795401765000,"y":-1.1},{"x":1795401827000,"y":-1.1},{"x":1795401889000,"y":-1.2},{"x":1795401950000,"y":-1.3},{"x":1795402012000,"y":-1.3},{"x":1795402074000,"y":-1.1},{"x":1795402136000,"y":-1.3},{"x":1795402198000,"y":-1.2},{"x":1795402259000,"y":-1.2},{"x":1795402321000,"y":-1.2},{"x":1795402383000,"y":-1.3},{"x":1795402445000,"y":-1.3},{"x":1795402507000,"y":-1.3},{"x":1795402569000,"y":-1.4},{"x":1795402630000,"y":-1.4},{"x":1795402692000,"y":-1.4},{"x":1795402754000,"y":-1.4},{"x":1795402816000,"y":-1.4},{"x":1795402878000,"y":-1.5},{"x":1795402939000,"y":-1.5},{"x":1795403001000,"y":-1.6},{"x":1795403063000,"y":-1.7},{"x":1795403125000,"y":-1.7},{"x":1795403187000,"y":-1.7},{"x":1795403249000,"y":-1.8},{"x":1795403310000,"y":-1.9},{"x":1795403372000,"y":-2}],"highlightExtremes":false,"unit":" °C"}], {"yLabel":"\u00b0C"}); }); $(document).ready(function() { buildMeteoChart('chart-humidity-canvas', 'chart-humidity-reset', [{"label":"Vlhkosť (%)","color":"#ff9000","points":[{"x":1795388431000,"y":73.4},{"x":1795388493000,"y":73.2},{"x":1795388555000,"y":73},{"x":1795388617000,"y":73},{"x":1795388679000,"y":72.8},{"x":1795388741000,"y":72.7},{"x":1795388803000,"y":72.4},{"x":1795388866000,"y":72.4},{"x":1795388927000,"y":72.7},{"x":1795388990000,"y":72.8},{"x":1795389053000,"y":73.2},{"x":1795389115000,"y":73.7},{"x":1795389178000,"y":74.2},{"x":1795389243000,"y":74.6},{"x":1795389310000,"y":74.8},{"x":1795389372000,"y":75.5},{"x":1795389435000,"y":75.8},{"x":1795389501000,"y":76.1},{"x":1795389564000,"y":76.2},{"x":1795389626000,"y":76.2},{"x":1795389687000,"y":76.2},{"x":1795389749000,"y":76.3},{"x":1795389811000,"y":76.2},{"x":1795389873000,"y":76.2},{"x":1795389935000,"y":76.2},{"x":1795389997000,"y":76.3},{"x":1795390059000,"y":76.6},{"x":1795390120000,"y":76.7},{"x":1795390182000,"y":77},{"x":1795390244000,"y":77.3},{"x":1795390306000,"y":77.7},{"x":1795390368000,"y":77.8},{"x":1795390429000,"y":78},{"x":1795390491000,"y":77.9},{"x":1795390553000,"y":77.8},{"x":1795390615000,"y":77.6},{"x":1795390677000,"y":77.4},{"x":1795390739000,"y":77.3},{"x":1795390800000,"y":77.4},{"x":1795390862000,"y":77.5},{"x":1795390924000,"y":77.7},{"x":1795390986000,"y":77.9},{"x":1795391048000,"y":78.2},{"x":1795391109000,"y":78.2},{"x":1795391171000,"y":78.1},{"x":1795391233000,"y":78.1},{"x":1795391295000,"y":78},{"x":1795391357000,"y":78.1},{"x":1795391419000,"y":78.1},{"x":1795391480000,"y":78.2},{"x":1795391542000,"y":78.2},{"x":1795391605000,"y":78.2},{"x":1795391666000,"y":78.2},{"x":1795391728000,"y":78.2},{"x":1795391789000,"y":78.2},{"x":1795391851000,"y":78.2},{"x":1795391918000,"y":78.3},{"x":1795391979000,"y":78.3},{"x":1795392042000,"y":78.4},{"x":1795392104000,"y":78.6},{"x":1795392165000,"y":78.8},{"x":1795392227000,"y":78.9},{"x":1795392289000,"y":78.9},{"x":1795392351000,"y":78.9},{"x":1795392413000,"y":79},{"x":1795392475000,"y":79},{"x":1795392537000,"y":79.2},{"x":1795392598000,"y":79.2},{"x":1795392660000,"y":79.2},{"x":1795392723000,"y":79},{"x":1795392785000,"y":79},{"x":1795392846000,"y":79},{"x":1795392908000,"y":79},{"x":1795392970000,"y":79},{"x":1795393032000,"y":79.2},{"x":1795393095000,"y":79.3},{"x":1795393156000,"y":79.5},{"x":1795393218000,"y":79.6},{"x":1795393280000,"y":79.7},{"x":1795393341000,"y":79.7},{"x":1795393404000,"y":79.9},{"x":1795393466000,"y":79.9},{"x":1795393527000,"y":80},{"x":1795393589000,"y":80.2},{"x":1795393651000,"y":80.2},{"x":1795393713000,"y":80.3},{"x":1795393775000,"y":80.3},{"x":1795393836000,"y":80.3},{"x":1795393898000,"y":80.3},{"x":1795393960000,"y":80.3},{"x":1795394022000,"y":80.3},{"x":1795394084000,"y":80.1},{"x":1795394146000,"y":80.2},{"x":1795394207000,"y":80.1},{"x":1795394270000,"y":80},{"x":1795394331000,"y":80},{"x":1795394394000,"y":80},{"x":1795394455000,"y":80},{"x":1795394517000,"y":79.9},{"x":1795394579000,"y":79.8},{"x":1795394640000,"y":79.8},{"x":1795394703000,"y":79.7},{"x":1795394765000,"y":79.6},{"x":1795394827000,"y":79.7},{"x":1795394889000,"y":79.6},{"x":1795394950000,"y":79.5},{"x":1795395012000,"y":79.5},{"x":1795395074000,"y":79.5},{"x":1795395136000,"y":79.4},{"x":1795395197000,"y":79.4},{"x":1795395259000,"y":79.4},{"x":1795395321000,"y":79.4},{"x":1795395382000,"y":79.4},{"x":1795395445000,"y":79.4},{"x":1795395506000,"y":79.3},{"x":1795395568000,"y":79.1},{"x":1795395630000,"y":79.2},{"x":1795395691000,"y":79.1},{"x":1795395754000,"y":79.1},{"x":1795395815000,"y":79.2},{"x":1795395877000,"y":79.1},{"x":1795395939000,"y":79.1},{"x":1795396000000,"y":79.3},{"x":1795396062000,"y":79.6},{"x":1795396124000,"y":79.6},{"x":1795396186000,"y":79.7},{"x":1795396248000,"y":79.8},{"x":1795396310000,"y":79.8},{"x":1795396372000,"y":79.7},{"x":1795396434000,"y":79.8},{"x":1795396495000,"y":79.7},{"x":1795396557000,"y":79.8},{"x":1795396619000,"y":80},{"x":1795396680000,"y":80},{"x":1795396743000,"y":80.1},{"x":1795396805000,"y":80.4},{"x":1795396866000,"y":80.4},{"x":1795396928000,"y":80.6},{"x":1795396990000,"y":80.7},{"x":1795397052000,"y":80.7},{"x":1795397114000,"y":80.6},{"x":1795397176000,"y":80.8},{"x":1795397238000,"y":80.9},{"x":1795397300000,"y":80.8},{"x":1795397361000,"y":80.8},{"x":1795397424000,"y":81},{"x":1795397486000,"y":81.2},{"x":1795397548000,"y":81.3},{"x":1795397609000,"y":81.4},{"x":1795397671000,"y":81.3},{"x":1795397733000,"y":81.1},{"x":1795397795000,"y":81.3},{"x":1795397857000,"y":81.4},{"x":1795397918000,"y":81.6},{"x":1795397980000,"y":81.8},{"x":1795398042000,"y":81.9},{"x":1795398104000,"y":82.2},{"x":1795398167000,"y":82.2},{"x":1795398228000,"y":82.2},{"x":1795398290000,"y":82.1},{"x":1795398351000,"y":82.1},{"x":1795398413000,"y":82.2},{"x":1795398475000,"y":82.4},{"x":1795398537000,"y":82.6},{"x":1795398599000,"y":82.7},{"x":1795398660000,"y":82.7},{"x":1795398722000,"y":82.7},{"x":1795398785000,"y":83},{"x":1795398846000,"y":83},{"x":1795398908000,"y":83},{"x":1795398970000,"y":83},{"x":1795399031000,"y":82.9},{"x":1795399093000,"y":82.9},{"x":1795399155000,"y":82.7},{"x":1795399217000,"y":82.8},{"x":1795399279000,"y":82.6},{"x":1795399340000,"y":82.5},{"x":1795399402000,"y":82.6},{"x":1795399464000,"y":82.6},{"x":1795399526000,"y":82.4},{"x":1795399588000,"y":82.5},{"x":1795399656000,"y":82.5},{"x":1795399718000,"y":82.5},{"x":1795399780000,"y":82.5},{"x":1795399842000,"y":82.4},{"x":1795399903000,"y":82.5},{"x":1795399966000,"y":82.5},{"x":1795400028000,"y":82.5},{"x":1795400089000,"y":82.7},{"x":1795400151000,"y":82.6},{"x":1795400213000,"y":82.6},{"x":1795400275000,"y":82.5},{"x":1795400337000,"y":82.4},{"x":1795400405000,"y":82.2},{"x":1795400467000,"y":82.3},{"x":1795400528000,"y":82.3},{"x":1795400590000,"y":82.2},{"x":1795400652000,"y":82.1},{"x":1795400714000,"y":82},{"x":1795400776000,"y":81.9},{"x":1795400837000,"y":81.9},{"x":1795400899000,"y":81.9},{"x":1795400961000,"y":81.9},{"x":1795401023000,"y":82},{"x":1795401085000,"y":82.3},{"x":1795401147000,"y":82.3},{"x":1795401208000,"y":82.1},{"x":1795401270000,"y":82},{"x":1795401332000,"y":82.1},{"x":1795401394000,"y":82.1},{"x":1795401456000,"y":82},{"x":1795401518000,"y":82.1},{"x":1795401579000,"y":82},{"x":1795401641000,"y":81.9},{"x":1795401703000,"y":82},{"x":1795401765000,"y":81.8},{"x":1795401827000,"y":81.6},{"x":1795401889000,"y":81.9},{"x":1795401950000,"y":82},{"x":1795402012000,"y":82.1},{"x":1795402074000,"y":82.2},{"x":1795402136000,"y":82},{"x":1795402198000,"y":82},{"x":1795402259000,"y":81.8},{"x":1795402321000,"y":81.6},{"x":1795402383000,"y":81.6},{"x":1795402445000,"y":81.5},{"x":1795402507000,"y":81.3},{"x":1795402569000,"y":80.9},{"x":1795402630000,"y":80.7},{"x":1795402692000,"y":80.7},{"x":1795402754000,"y":80.7},{"x":1795402816000,"y":80.6},{"x":1795402878000,"y":80.2},{"x":1795402939000,"y":80.2},{"x":1795403001000,"y":79.6},{"x":1795403063000,"y":79.2},{"x":1795403125000,"y":78.8},{"x":1795403187000,"y":78.7},{"x":1795403249000,"y":77.9},{"x":1795403310000,"y":77.2},{"x":1795403372000,"y":76.7}],"highlightExtremes":true,"unit":" %"}], {"yLabel":"%"}); }); $(document).ready(function() { buildMeteoChart('chart-pressure-canvas', 'chart-pressure-reset', [{"label":"Atmosférický tlak (hPa)","color":"#000000","points":[{"x":1795388431000,"y":1010},{"x":1795388493000,"y":1010},{"x":1795388555000,"y":1010},{"x":1795388617000,"y":1010},{"x":1795388679000,"y":1010},{"x":1795388741000,"y":1009.9},{"x":1795388803000,"y":1009.9},{"x":1795388866000,"y":1009.9},{"x":1795388927000,"y":1010},{"x":1795388990000,"y":1009.9},{"x":1795389053000,"y":1009.9},{"x":1795389115000,"y":1010},{"x":1795389178000,"y":1009.9},{"x":1795389243000,"y":1010},{"x":1795389310000,"y":1010},{"x":1795389372000,"y":1010.1},{"x":1795389435000,"y":1010.1},{"x":1795389501000,"y":1010.1},{"x":1795389564000,"y":1010.2},{"x":1795389626000,"y":1010.1},{"x":1795389687000,"y":1010.1},{"x":1795389749000,"y":1010.1},{"x":1795389811000,"y":1010.1},{"x":1795389873000,"y":1010},{"x":1795389935000,"y":1010.1},{"x":1795389997000,"y":1010.1},{"x":1795390059000,"y":1010.1},{"x":1795390120000,"y":1010.1},{"x":1795390182000,"y":1010.1},{"x":1795390244000,"y":1010.1},{"x":1795390306000,"y":1010.2},{"x":1795390368000,"y":1010.2},{"x":1795390429000,"y":1010.3},{"x":1795390491000,"y":1010.2},{"x":1795390553000,"y":1010.2},{"x":1795390615000,"y":1010.3},{"x":1795390677000,"y":1010.3},{"x":1795390739000,"y":1010.2},{"x":1795390800000,"y":1010.2},{"x":1795390862000,"y":1010.3},{"x":1795390924000,"y":1010.4},{"x":1795390986000,"y":1010.3},{"x":1795391048000,"y":1010.4},{"x":1795391109000,"y":1010.4},{"x":1795391171000,"y":1010.5},{"x":1795391233000,"y":1010.5},{"x":1795391295000,"y":1010.5},{"x":1795391357000,"y":1010.5},{"x":1795391419000,"y":1010.5},{"x":1795391480000,"y":1010.5},{"x":1795391542000,"y":1010.6},{"x":1795391605000,"y":1010.6},{"x":1795391666000,"y":1010.6},{"x":1795391728000,"y":1010.6},{"x":1795391789000,"y":1010.6},{"x":1795391851000,"y":1010.5},{"x":1795391918000,"y":1010.6},{"x":1795391979000,"y":1010.6},{"x":1795392042000,"y":1010.6},{"x":1795392104000,"y":1010.7},{"x":1795392165000,"y":1010.7},{"x":1795392227000,"y":1010.7},{"x":1795392289000,"y":1010.7},{"x":1795392351000,"y":1010.7},{"x":1795392413000,"y":1010.7},{"x":1795392475000,"y":1010.8},{"x":1795392537000,"y":1010.7},{"x":1795392598000,"y":1010.7},{"x":1795392660000,"y":1010.7},{"x":1795392723000,"y":1010.7},{"x":1795392785000,"y":1010.8},{"x":1795392846000,"y":1010.8},{"x":1795392908000,"y":1010.8},{"x":1795392970000,"y":1010.9},{"x":1795393032000,"y":1010.9},{"x":1795393095000,"y":1010.9},{"x":1795393156000,"y":1011},{"x":1795393218000,"y":1011},{"x":1795393280000,"y":1011},{"x":1795393341000,"y":1011.1},{"x":1795393404000,"y":1011},{"x":1795393466000,"y":1011.1},{"x":1795393527000,"y":1011},{"x":1795393589000,"y":1011.1},{"x":1795393651000,"y":1011.1},{"x":1795393713000,"y":1011.1},{"x":1795393775000,"y":1011.1},{"x":1795393836000,"y":1011.1},{"x":1795393898000,"y":1011.1},{"x":1795393960000,"y":1011.1},{"x":1795394022000,"y":1011.2},{"x":1795394084000,"y":1011.2},{"x":1795394146000,"y":1011.2},{"x":1795394207000,"y":1011.1},{"x":1795394270000,"y":1011.2},{"x":1795394331000,"y":1011.2},{"x":1795394394000,"y":1011.1},{"x":1795394455000,"y":1011.2},{"x":1795394517000,"y":1011.2},{"x":1795394579000,"y":1011.2},{"x":1795394640000,"y":1011.2},{"x":1795394703000,"y":1011.2},{"x":1795394765000,"y":1011.2},{"x":1795394827000,"y":1011.2},{"x":1795394889000,"y":1011.3},{"x":1795394950000,"y":1011.3},{"x":1795395012000,"y":1011.3},{"x":1795395074000,"y":1011.2},{"x":1795395136000,"y":1011.2},{"x":1795395197000,"y":1011.2},{"x":1795395259000,"y":1011.2},{"x":1795395321000,"y":1011.3},{"x":1795395382000,"y":1011.3},{"x":1795395445000,"y":1011.4},{"x":1795395506000,"y":1011.5},{"x":1795395568000,"y":1011.4},{"x":1795395630000,"y":1011.5},{"x":1795395691000,"y":1011.6},{"x":1795395754000,"y":1011.6},{"x":1795395815000,"y":1011.4},{"x":1795395877000,"y":1011.5},{"x":1795395939000,"y":1011.5},{"x":1795396000000,"y":1011.5},{"x":1795396062000,"y":1011.5},{"x":1795396124000,"y":1011.5},{"x":1795396186000,"y":1011.4},{"x":1795396248000,"y":1011.4},{"x":1795396310000,"y":1011.4},{"x":1795396372000,"y":1011.3},{"x":1795396434000,"y":1011.4},{"x":1795396495000,"y":1011.4},{"x":1795396557000,"y":1011.4},{"x":1795396619000,"y":1011.4},{"x":1795396680000,"y":1011.6},{"x":1795396743000,"y":1011.5},{"x":1795396805000,"y":1011.5},{"x":1795396866000,"y":1011.5},{"x":1795396928000,"y":1011.5},{"x":1795396990000,"y":1011.5},{"x":1795397052000,"y":1011.5},{"x":1795397114000,"y":1011.5},{"x":1795397176000,"y":1011.7},{"x":1795397238000,"y":1011.6},{"x":1795397300000,"y":1011.6},{"x":1795397361000,"y":1011.6},{"x":1795397424000,"y":1011.7},{"x":1795397486000,"y":1011.7},{"x":1795397548000,"y":1011.6},{"x":1795397609000,"y":1011.7},{"x":1795397671000,"y":1011.7},{"x":1795397733000,"y":1011.7},{"x":1795397795000,"y":1011.7},{"x":1795397857000,"y":1011.7},{"x":1795397918000,"y":1011.8},{"x":1795397980000,"y":1011.9},{"x":1795398042000,"y":1011.8},{"x":1795398104000,"y":1011.9},{"x":1795398167000,"y":1011.8},{"x":1795398228000,"y":1011.8},{"x":1795398290000,"y":1011.8},{"x":1795398351000,"y":1011.9},{"x":1795398413000,"y":1012},{"x":1795398475000,"y":1012},{"x":1795398537000,"y":1012.1},{"x":1795398599000,"y":1012.1},{"x":1795398660000,"y":1012.2},{"x":1795398722000,"y":1012.2},{"x":1795398785000,"y":1012.1},{"x":1795398846000,"y":1012.1},{"x":1795398908000,"y":1012.2},{"x":1795398970000,"y":1012.1},{"x":1795399031000,"y":1012.1},{"x":1795399093000,"y":1012.1},{"x":1795399155000,"y":1012.2},{"x":1795399217000,"y":1012.1},{"x":1795399279000,"y":1012.1},{"x":1795399340000,"y":1012.1},{"x":1795399402000,"y":1012},{"x":1795399464000,"y":1012.1},{"x":1795399526000,"y":1012.1},{"x":1795399588000,"y":1012.2},{"x":1795399656000,"y":1012.1},{"x":1795399718000,"y":1012.2},{"x":1795399780000,"y":1012.2},{"x":1795399842000,"y":1012.2},{"x":1795399903000,"y":1012.1},{"x":1795399966000,"y":1012.2},{"x":1795400028000,"y":1012.2},{"x":1795400089000,"y":1012.3},{"x":1795400151000,"y":1012.2},{"x":1795400213000,"y":1012.3},{"x":1795400275000,"y":1012.3},{"x":1795400337000,"y":1012.3},{"x":1795400405000,"y":1012.3},{"x":1795400467000,"y":1012.4},{"x":1795400528000,"y":1012.4},{"x":1795400590000,"y":1012.5},{"x":1795400652000,"y":1012.4},{"x":1795400714000,"y":1012.5},{"x":1795400776000,"y":1012.5},{"x":1795400837000,"y":1012.5},{"x":1795400899000,"y":1012.5},{"x":1795400961000,"y":1012.5},{"x":1795401023000,"y":1012.5},{"x":1795401085000,"y":1012.5},{"x":1795401147000,"y":1012.6},{"x":1795401208000,"y":1012.4},{"x":1795401270000,"y":1012.5},{"x":1795401332000,"y":1012.5},{"x":1795401394000,"y":1012.4},{"x":1795401456000,"y":1012.5},{"x":1795401518000,"y":1012.5},{"x":1795401579000,"y":1012.5},{"x":1795401641000,"y":1012.4},{"x":1795401703000,"y":1012.4},{"x":1795401765000,"y":1012.4},{"x":1795401827000,"y":1012.5},{"x":1795401889000,"y":1012.4},{"x":1795401950000,"y":1012.5},{"x":1795402012000,"y":1012.5},{"x":1795402074000,"y":1012.4},{"x":1795402136000,"y":1012.5},{"x":1795402198000,"y":1012.5},{"x":1795402259000,"y":1012.5},{"x":1795402321000,"y":1012.5},{"x":1795402383000,"y":1012.6},{"x":1795402445000,"y":1012.6},{"x":1795402507000,"y":1012.7},{"x":1795402569000,"y":1012.7},{"x":1795402630000,"y":1012.7},{"x":1795402692000,"y":1012.8},{"x":1795402754000,"y":1012.7},{"x":1795402816000,"y":1012.7},{"x":1795402878000,"y":1012.8},{"x":1795402939000,"y":1012.8},{"x":1795403001000,"y":1012.8},{"x":1795403063000,"y":1012.8},{"x":1795403125000,"y":1012.8},{"x":1795403187000,"y":1012.8},{"x":1795403249000,"y":1012.8},{"x":1795403310000,"y":1012.9},{"x":1795403372000,"y":1012.8}],"highlightExtremes":true,"unit":" hPa"}], {"yLabel":"hPa"}); }); $('.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; }