var meteoCharts = {}; var meteoCompassLabels = {0: 'S', 90: 'V', 180: 'J', 270: 'Z', 360: 'S'}; var meteoRangeMin = 1791151200000; var meteoRangeMax = 1791153226000; 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":1791151249000,"y":5},{"x":1791151309000,"y":5},{"x":1791151370000,"y":5},{"x":1791151429000,"y":5},{"x":1791151489000,"y":5},{"x":1791151549000,"y":5},{"x":1791151609000,"y":5.0999999999999996447286321199499070644378662109375},{"x":1791151670000,"y":5.20000000000000017763568394002504646778106689453125},{"x":1791151729000,"y":5.20000000000000017763568394002504646778106689453125},{"x":1791151789000,"y":5.20000000000000017763568394002504646778106689453125},{"x":1791151849000,"y":5.29999999999999982236431605997495353221893310546875},{"x":1791151909000,"y":5.29999999999999982236431605997495353221893310546875},{"x":1791151970000,"y":5.20000000000000017763568394002504646778106689453125},{"x":1791152029000,"y":5.20000000000000017763568394002504646778106689453125},{"x":1791152089000,"y":5.29999999999999982236431605997495353221893310546875},{"x":1791152149000,"y":5.4000000000000003552713678800500929355621337890625},{"x":1791152209000,"y":5.5},{"x":1791152270000,"y":5.5999999999999996447286321199499070644378662109375},{"x":1791152329000,"y":5.5999999999999996447286321199499070644378662109375},{"x":1791152389000,"y":5.70000000000000017763568394002504646778106689453125},{"x":1791152449000,"y":5.79999999999999982236431605997495353221893310546875},{"x":1791152509000,"y":5.9000000000000003552713678800500929355621337890625},{"x":1791152570000,"y":5.9000000000000003552713678800500929355621337890625},{"x":1791152628000,"y":5.9000000000000003552713678800500929355621337890625},{"x":1791152688000,"y":6},{"x":1791152748000,"y":6},{"x":1791152808000,"y":6.20000000000000017763568394002504646778106689453125},{"x":1791152869000,"y":6.29999999999999982236431605997495353221893310546875},{"x":1791152928000,"y":6.4000000000000003552713678800500929355621337890625},{"x":1791152988000,"y":6.5},{"x":1791153048000,"y":6.4000000000000003552713678800500929355621337890625},{"x":1791153108000,"y":6.29999999999999982236431605997495353221893310546875},{"x":1791153169000,"y":6.20000000000000017763568394002504646778106689453125}],"highlightExtremes":true,"unit":" °C"},{"label":"Rosný bod (°C)","color":"#5b9f4a","points":[{"x":1791151249000,"y":3.79999999999999982236431605997495353221893310546875},{"x":1791151309000,"y":3.899999999999999911182158029987476766109466552734375},{"x":1791151370000,"y":3.899999999999999911182158029987476766109466552734375},{"x":1791151429000,"y":3.899999999999999911182158029987476766109466552734375},{"x":1791151489000,"y":3.79999999999999982236431605997495353221893310546875},{"x":1791151549000,"y":3.899999999999999911182158029987476766109466552734375},{"x":1791151609000,"y":4},{"x":1791151670000,"y":4.0999999999999996447286321199499070644378662109375},{"x":1791151729000,"y":4.0999999999999996447286321199499070644378662109375},{"x":1791151789000,"y":4.0999999999999996447286321199499070644378662109375},{"x":1791151849000,"y":4.0999999999999996447286321199499070644378662109375},{"x":1791151909000,"y":3.79999999999999982236431605997495353221893310546875},{"x":1791151970000,"y":3.79999999999999982236431605997495353221893310546875},{"x":1791152029000,"y":3.79999999999999982236431605997495353221893310546875},{"x":1791152089000,"y":4.0999999999999996447286321199499070644378662109375},{"x":1791152149000,"y":4.20000000000000017763568394002504646778106689453125},{"x":1791152209000,"y":4.29999999999999982236431605997495353221893310546875},{"x":1791152270000,"y":4.4000000000000003552713678800500929355621337890625},{"x":1791152329000,"y":4.4000000000000003552713678800500929355621337890625},{"x":1791152389000,"y":4.5},{"x":1791152449000,"y":4.5999999999999996447286321199499070644378662109375},{"x":1791152509000,"y":4.5},{"x":1791152570000,"y":4.5},{"x":1791152628000,"y":4.5},{"x":1791152688000,"y":4.5},{"x":1791152748000,"y":4.5},{"x":1791152808000,"y":4.70000000000000017763568394002504646778106689453125},{"x":1791152869000,"y":4.79999999999999982236431605997495353221893310546875},{"x":1791152928000,"y":4.9000000000000003552713678800500929355621337890625},{"x":1791152988000,"y":4.79999999999999982236431605997495353221893310546875},{"x":1791153048000,"y":4.70000000000000017763568394002504646778106689453125},{"x":1791153108000,"y":4.5999999999999996447286321199499070644378662109375},{"x":1791153169000,"y":4.5}],"highlightExtremes":false,"unit":" °C"}], {"yLabel":"\u00b0C"}); }); $(document).ready(function() { buildMeteoChart('chart-ground-temperature-canvas', 'chart-ground-temperature-reset', [{"label":"5 cm nad povrchom (°C)","color":"#f39c12","points":[{"x":1791151249000,"y":2.100000000000000088817841970012523233890533447265625},{"x":1791151309000,"y":2.100000000000000088817841970012523233890533447265625},{"x":1791151370000,"y":2.100000000000000088817841970012523233890533447265625},{"x":1791151429000,"y":2.100000000000000088817841970012523233890533447265625},{"x":1791151489000,"y":2.100000000000000088817841970012523233890533447265625},{"x":1791151549000,"y":2.100000000000000088817841970012523233890533447265625},{"x":1791151609000,"y":2.20000000000000017763568394002504646778106689453125},{"x":1791151670000,"y":2.20000000000000017763568394002504646778106689453125},{"x":1791151729000,"y":2.29999999999999982236431605997495353221893310546875},{"x":1791151789000,"y":2.399999999999999911182158029987476766109466552734375},{"x":1791151849000,"y":2.5},{"x":1791151909000,"y":2.70000000000000017763568394002504646778106689453125},{"x":1791151970000,"y":2.79999999999999982236431605997495353221893310546875},{"x":1791152029000,"y":2.79999999999999982236431605997495353221893310546875},{"x":1791152089000,"y":2.899999999999999911182158029987476766109466552734375},{"x":1791152149000,"y":3},{"x":1791152209000,"y":3},{"x":1791152270000,"y":3},{"x":1791152329000,"y":2.899999999999999911182158029987476766109466552734375},{"x":1791152389000,"y":2.899999999999999911182158029987476766109466552734375},{"x":1791152449000,"y":3.100000000000000088817841970012523233890533447265625},{"x":1791152509000,"y":3},{"x":1791152570000,"y":2.899999999999999911182158029987476766109466552734375},{"x":1791152628000,"y":2.79999999999999982236431605997495353221893310546875},{"x":1791152688000,"y":2.79999999999999982236431605997495353221893310546875},{"x":1791152748000,"y":2.70000000000000017763568394002504646778106689453125},{"x":1791152808000,"y":2.70000000000000017763568394002504646778106689453125},{"x":1791152869000,"y":2.70000000000000017763568394002504646778106689453125},{"x":1791152928000,"y":2.70000000000000017763568394002504646778106689453125},{"x":1791152988000,"y":2.70000000000000017763568394002504646778106689453125},{"x":1791153048000,"y":2.70000000000000017763568394002504646778106689453125},{"x":1791153108000,"y":2.70000000000000017763568394002504646778106689453125},{"x":1791153169000,"y":2.70000000000000017763568394002504646778106689453125}],"highlightExtremes":true,"unit":" °C"}], {"yLabel":"\u00b0C"}); }); $(document).ready(function() { buildMeteoChart('chart-ground-humidity-canvas', 'chart-ground-humidity-reset', [{"label":"10 cm pod povrchom (%)","color":"#00a8cc","points":[{"x":1791151249000,"y":24},{"x":1791151309000,"y":24},{"x":1791151370000,"y":24},{"x":1791151429000,"y":24},{"x":1791151489000,"y":24},{"x":1791151549000,"y":24},{"x":1791151609000,"y":25},{"x":1791151670000,"y":24},{"x":1791151729000,"y":24},{"x":1791151789000,"y":24},{"x":1791151849000,"y":24},{"x":1791151909000,"y":25},{"x":1791151970000,"y":24},{"x":1791152029000,"y":24},{"x":1791152089000,"y":25},{"x":1791152149000,"y":25},{"x":1791152209000,"y":24},{"x":1791152270000,"y":24},{"x":1791152329000,"y":25},{"x":1791152389000,"y":24},{"x":1791152449000,"y":25},{"x":1791152509000,"y":25},{"x":1791152570000,"y":25},{"x":1791152628000,"y":25},{"x":1791152688000,"y":25},{"x":1791152748000,"y":25},{"x":1791152808000,"y":24},{"x":1791152869000,"y":24},{"x":1791152928000,"y":25},{"x":1791152988000,"y":25},{"x":1791153048000,"y":24},{"x":1791153108000,"y":25},{"x":1791153169000,"y":25}],"highlightExtremes":true,"unit":" %"}], {"yLabel":"%"}); }); $(document).ready(function() { buildMeteoChart('chart-humidity-canvas', 'chart-humidity-reset', [{"label":"Vlhkosť (%)","color":"#ff9000","points":[{"x":1791151249000,"y":92},{"x":1791151309000,"y":93},{"x":1791151370000,"y":93},{"x":1791151429000,"y":93},{"x":1791151489000,"y":92},{"x":1791151549000,"y":93},{"x":1791151609000,"y":93},{"x":1791151670000,"y":93},{"x":1791151729000,"y":93},{"x":1791151789000,"y":93},{"x":1791151849000,"y":92},{"x":1791151909000,"y":90},{"x":1791151970000,"y":91},{"x":1791152029000,"y":91},{"x":1791152089000,"y":92},{"x":1791152149000,"y":92},{"x":1791152209000,"y":92},{"x":1791152270000,"y":92},{"x":1791152329000,"y":92},{"x":1791152389000,"y":92},{"x":1791152449000,"y":92},{"x":1791152509000,"y":91},{"x":1791152570000,"y":91},{"x":1791152628000,"y":91},{"x":1791152688000,"y":90},{"x":1791152748000,"y":90},{"x":1791152808000,"y":90},{"x":1791152869000,"y":90},{"x":1791152928000,"y":90},{"x":1791152988000,"y":89},{"x":1791153048000,"y":89},{"x":1791153108000,"y":89},{"x":1791153169000,"y":89}],"highlightExtremes":true,"unit":" %"}], {"yLabel":"%"}); }); $(document).ready(function() { buildMeteoChart('chart-pressure-canvas', 'chart-pressure-reset', [{"label":"Atmosférický tlak (hPa)","color":"#000000","points":[{"x":1791151249000,"y":1027.90000000000009094947017729282379150390625},{"x":1791151309000,"y":1027.700000000000045474735088646411895751953125},{"x":1791151370000,"y":1027.799999999999954525264911353588104248046875},{"x":1791151429000,"y":1027.799999999999954525264911353588104248046875},{"x":1791151489000,"y":1027.700000000000045474735088646411895751953125},{"x":1791151549000,"y":1027.700000000000045474735088646411895751953125},{"x":1791151609000,"y":1027.799999999999954525264911353588104248046875},{"x":1791151670000,"y":1027.799999999999954525264911353588104248046875},{"x":1791151729000,"y":1027.700000000000045474735088646411895751953125},{"x":1791151789000,"y":1027.700000000000045474735088646411895751953125},{"x":1791151849000,"y":1027.700000000000045474735088646411895751953125},{"x":1791151909000,"y":1027.700000000000045474735088646411895751953125},{"x":1791151970000,"y":1027.90000000000009094947017729282379150390625},{"x":1791152029000,"y":1027.799999999999954525264911353588104248046875},{"x":1791152089000,"y":1027.799999999999954525264911353588104248046875},{"x":1791152149000,"y":1027.59999999999990905052982270717620849609375},{"x":1791152209000,"y":1027.5},{"x":1791152270000,"y":1027.5},{"x":1791152329000,"y":1027.59999999999990905052982270717620849609375},{"x":1791152389000,"y":1027.5},{"x":1791152449000,"y":1027.700000000000045474735088646411895751953125},{"x":1791152509000,"y":1027.799999999999954525264911353588104248046875},{"x":1791152570000,"y":1027.59999999999990905052982270717620849609375},{"x":1791152628000,"y":1027.59999999999990905052982270717620849609375},{"x":1791152688000,"y":1027.700000000000045474735088646411895751953125},{"x":1791152748000,"y":1027.59999999999990905052982270717620849609375},{"x":1791152808000,"y":1027.700000000000045474735088646411895751953125},{"x":1791152869000,"y":1027.40000000000009094947017729282379150390625},{"x":1791152928000,"y":1027.5},{"x":1791152988000,"y":1027.299999999999954525264911353588104248046875},{"x":1791153048000,"y":1027.5},{"x":1791153108000,"y":1027.299999999999954525264911353588104248046875},{"x":1791153169000,"y":1027.299999999999954525264911353588104248046875}],"highlightExtremes":true,"unit":" hPa"}], {"yLabel":"hPa"}); }); $(document).ready(function() { buildMeteoChart('chart-wind-canvas', 'chart-wind-reset', [{"label":"Rýchlosť vetra (km\/h)","color":"#002f80","points":[{"x":1791151249000,"y":0},{"x":1791151309000,"y":0},{"x":1791151370000,"y":0},{"x":1791151429000,"y":0},{"x":1791151489000,"y":0},{"x":1791151549000,"y":0},{"x":1791151609000,"y":0},{"x":1791151670000,"y":0},{"x":1791151729000,"y":1.100000000000000088817841970012523233890533447265625},{"x":1791151789000,"y":2.20000000000000017763568394002504646778106689453125},{"x":1791151849000,"y":2.5},{"x":1791151909000,"y":2.5},{"x":1791151970000,"y":2.899999999999999911182158029987476766109466552734375},{"x":1791152029000,"y":2.20000000000000017763568394002504646778106689453125},{"x":1791152089000,"y":2.5},{"x":1791152149000,"y":1.399999999999999911182158029987476766109466552734375},{"x":1791152209000,"y":0.40000000000000002220446049250313080847263336181640625},{"x":1791152270000,"y":0.40000000000000002220446049250313080847263336181640625},{"x":1791152329000,"y":1.100000000000000088817841970012523233890533447265625},{"x":1791152389000,"y":1.399999999999999911182158029987476766109466552734375},{"x":1791152449000,"y":1.399999999999999911182158029987476766109466552734375},{"x":1791152509000,"y":1.399999999999999911182158029987476766109466552734375},{"x":1791152570000,"y":0},{"x":1791152628000,"y":0},{"x":1791152688000,"y":0},{"x":1791152748000,"y":0},{"x":1791152808000,"y":0},{"x":1791152869000,"y":0},{"x":1791152928000,"y":0},{"x":1791152988000,"y":0},{"x":1791153048000,"y":0},{"x":1791153108000,"y":0},{"x":1791153169000,"y":0}],"highlightExtremes":true,"unit":" km\/h"},{"label":"Náraz vetra (km\/h)","color":"#EF9856","points":[{"x":1791151249000,"y":0},{"x":1791151309000,"y":0},{"x":1791151370000,"y":0},{"x":1791151429000,"y":0},{"x":1791151489000,"y":0},{"x":1791151549000,"y":0},{"x":1791151609000,"y":0},{"x":1791151670000,"y":0},{"x":1791151729000,"y":2.5},{"x":1791151789000,"y":2.5},{"x":1791151849000,"y":2.5},{"x":1791151909000,"y":5},{"x":1791151970000,"y":5},{"x":1791152029000,"y":5},{"x":1791152089000,"y":2.5},{"x":1791152149000,"y":2.5},{"x":1791152209000,"y":2.5},{"x":1791152270000,"y":2.5},{"x":1791152329000,"y":2.5},{"x":1791152389000,"y":2.5},{"x":1791152449000,"y":2.5},{"x":1791152509000,"y":2.5},{"x":1791152570000,"y":2.5},{"x":1791152628000,"y":0},{"x":1791152688000,"y":0},{"x":1791152748000,"y":0},{"x":1791152808000,"y":0},{"x":1791152869000,"y":0},{"x":1791152928000,"y":0},{"x":1791152988000,"y":0},{"x":1791153048000,"y":0},{"x":1791153108000,"y":0},{"x":1791153169000,"y":0}],"highlightExtremes":true,"unit":" km\/h","showLine":false,"pointRadius":3}], {"yLabel":"km\/h"}); }); $(document).ready(function() { buildMeteoChart('chart-wind-direction-canvas', 'chart-wind-direction-reset', [{"label":"Smer vetra","color":"#002f80","points":[{"x":1791151249000,"y":152},{"x":1791151309000,"y":152},{"x":1791151370000,"y":152},{"x":1791151429000,"y":152},{"x":1791151489000,"y":152},{"x":1791151549000,"y":152},{"x":1791151609000,"y":152},{"x":1791151670000,"y":152},{"x":1791151729000,"y":152},{"x":1791151789000,"y":152},{"x":1791151849000,"y":151},{"x":1791151909000,"y":151},{"x":1791151970000,"y":151},{"x":1791152029000,"y":151},{"x":1791152089000,"y":151},{"x":1791152149000,"y":151},{"x":1791152209000,"y":152},{"x":1791152270000,"y":152},{"x":1791152329000,"y":152},{"x":1791152389000,"y":152},{"x":1791152449000,"y":152},{"x":1791152509000,"y":152},{"x":1791152570000,"y":152},{"x":1791152628000,"y":152},{"x":1791152688000,"y":152},{"x":1791152748000,"y":152},{"x":1791152808000,"y":152},{"x":1791152869000,"y":152},{"x":1791152928000,"y":152},{"x":1791152988000,"y":152},{"x":1791153048000,"y":152},{"x":1791153108000,"y":152},{"x":1791153169000,"y":152}],"highlightExtremes":false,"showLine":false,"pointRadius":3,"tooltipMode":"windDirection"}], {"yMode":"compass"}); }); $(document).ready(function() { buildMeteoChart('chart-solar-radiation-canvas', 'chart-solar-radiation-reset', [{"label":"Slnečné žiarenie (W\/m2)","color":"#ffb92f","points":[{"x":1791151249000,"y":0},{"x":1791151309000,"y":0},{"x":1791151370000,"y":0},{"x":1791151429000,"y":0},{"x":1791151489000,"y":0},{"x":1791151549000,"y":0},{"x":1791151609000,"y":0},{"x":1791151670000,"y":0},{"x":1791151729000,"y":0},{"x":1791151789000,"y":0},{"x":1791151849000,"y":0},{"x":1791151909000,"y":0},{"x":1791151970000,"y":0},{"x":1791152029000,"y":0},{"x":1791152089000,"y":0},{"x":1791152149000,"y":0},{"x":1791152209000,"y":0},{"x":1791152270000,"y":0},{"x":1791152329000,"y":0},{"x":1791152389000,"y":0},{"x":1791152449000,"y":0},{"x":1791152509000,"y":0},{"x":1791152570000,"y":0},{"x":1791152628000,"y":0},{"x":1791152688000,"y":0},{"x":1791152748000,"y":0},{"x":1791152808000,"y":0},{"x":1791152869000,"y":0},{"x":1791152928000,"y":0},{"x":1791152988000,"y":0},{"x":1791153048000,"y":0},{"x":1791153108000,"y":0},{"x":1791153169000,"y":0}],"highlightExtremes":true,"unit":" W\/m2"}], {"yLabel":"W\/m2","yMin":0}); }); $(document).ready(function() { buildMeteoChart('chart-uv-canvas', 'chart-uv-reset', [{"label":"UV žiarenie","color":"#802674","points":[{"x":1791151249000,"y":0},{"x":1791151309000,"y":0},{"x":1791151370000,"y":0},{"x":1791151429000,"y":0},{"x":1791151489000,"y":0},{"x":1791151549000,"y":0},{"x":1791151609000,"y":0},{"x":1791151670000,"y":0},{"x":1791151729000,"y":0},{"x":1791151789000,"y":0},{"x":1791151849000,"y":0},{"x":1791151909000,"y":0},{"x":1791151970000,"y":0},{"x":1791152029000,"y":0},{"x":1791152089000,"y":0},{"x":1791152149000,"y":0},{"x":1791152209000,"y":0},{"x":1791152270000,"y":0},{"x":1791152329000,"y":0},{"x":1791152389000,"y":0},{"x":1791152449000,"y":0},{"x":1791152509000,"y":0},{"x":1791152570000,"y":0},{"x":1791152628000,"y":0},{"x":1791152688000,"y":0},{"x":1791152748000,"y":0},{"x":1791152808000,"y":0},{"x":1791152869000,"y":0},{"x":1791152928000,"y":0},{"x":1791152988000,"y":0},{"x":1791153048000,"y":0},{"x":1791153108000,"y":0},{"x":1791153169000,"y":0}],"highlightExtremes":true}], {"yMin":0}); }); $(document).ready(function() { buildMeteoChart('chart-rain-canvas', 'chart-rain-reset', [{"label":"Zrážky (mm)","color":"#008fbf","points":[{"x":1791151249000,"y":0},{"x":1791151309000,"y":0},{"x":1791151370000,"y":0},{"x":1791151429000,"y":0},{"x":1791151489000,"y":0},{"x":1791151549000,"y":0},{"x":1791151609000,"y":0},{"x":1791151670000,"y":0},{"x":1791151729000,"y":0},{"x":1791151789000,"y":0},{"x":1791151849000,"y":0},{"x":1791151909000,"y":0},{"x":1791151970000,"y":0},{"x":1791152029000,"y":0},{"x":1791152089000,"y":0},{"x":1791152149000,"y":0},{"x":1791152209000,"y":0},{"x":1791152270000,"y":0},{"x":1791152329000,"y":0},{"x":1791152389000,"y":0},{"x":1791152449000,"y":0},{"x":1791152509000,"y":0},{"x":1791152570000,"y":0},{"x":1791152628000,"y":0},{"x":1791152688000,"y":0},{"x":1791152748000,"y":0},{"x":1791152808000,"y":0},{"x":1791152869000,"y":0},{"x":1791152928000,"y":0},{"x":1791152988000,"y":0},{"x":1791153048000,"y":0},{"x":1791153108000,"y":0},{"x":1791153169000,"y":0}],"highlightExtremes":false,"unit":" mm"}], {"yLabel":"mm","yMin":0}); }); $('.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; }