var meteoCharts = {}; var meteoCompassLabels = {0: 'S', 90: 'V', 180: 'J', 270: 'Z', 360: 'S'}; var meteoRangeMin = 1792188000000; var meteoRangeMax = 1792205152000; 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":1792188000000,"y":9.8},{"x":1792188060000,"y":9.8},{"x":1792188120000,"y":9.8},{"x":1792188180000,"y":9.8},{"x":1792188240000,"y":9.9},{"x":1792188300000,"y":9.8},{"x":1792188360000,"y":9.8},{"x":1792188420000,"y":9.8},{"x":1792188480000,"y":9.8},{"x":1792188540000,"y":9.8},{"x":1792188600000,"y":9.9},{"x":1792188660000,"y":10},{"x":1792188720000,"y":9.9},{"x":1792188780000,"y":9.8},{"x":1792188840000,"y":9.7},{"x":1792188900000,"y":9.6},{"x":1792188960000,"y":9.6},{"x":1792189020000,"y":9.6},{"x":1792189080000,"y":9.7},{"x":1792189140000,"y":9.6},{"x":1792189200000,"y":9.9},{"x":1792189260000,"y":9.9},{"x":1792189320000,"y":9.9},{"x":1792189380000,"y":10},{"x":1792189440000,"y":9.9},{"x":1792189500000,"y":9.9},{"x":1792189560000,"y":9.9},{"x":1792189620000,"y":10},{"x":1792189680000,"y":9.9},{"x":1792189740000,"y":9.9},{"x":1792189800000,"y":9.7},{"x":1792189860000,"y":9.5},{"x":1792189920000,"y":9.4},{"x":1792189980000,"y":8.9},{"x":1792190040000,"y":8.2},{"x":1792190100000,"y":7.8},{"x":1792190160000,"y":7.7},{"x":1792190220000,"y":7.7},{"x":1792190280000,"y":7.9},{"x":1792190340000,"y":7.9},{"x":1792190400000,"y":8.1},{"x":1792190460000,"y":8.2},{"x":1792190520000,"y":8.3},{"x":1792190580000,"y":8.4},{"x":1792190640000,"y":8.6},{"x":1792190700000,"y":8.5},{"x":1792190760000,"y":8.1},{"x":1792190820000,"y":7.9},{"x":1792190880000,"y":7.9},{"x":1792190940000,"y":8},{"x":1792191000000,"y":7.9},{"x":1792191060000,"y":7.9},{"x":1792191120000,"y":8.2},{"x":1792191180000,"y":8.2},{"x":1792191240000,"y":8},{"x":1792191300000,"y":7.6},{"x":1792191360000,"y":7.4},{"x":1792191420000,"y":7.5},{"x":1792191480000,"y":7.6},{"x":1792191540000,"y":7.7},{"x":1792191600000,"y":7.7},{"x":1792191660000,"y":7.6},{"x":1792191720000,"y":7.8},{"x":1792191780000,"y":7.9},{"x":1792191840000,"y":8.1},{"x":1792191900000,"y":8.1},{"x":1792191960000,"y":8.1},{"x":1792192020000,"y":8.1},{"x":1792192080000,"y":7.9},{"x":1792192140000,"y":7.7},{"x":1792192200000,"y":7.7},{"x":1792192260000,"y":7.6},{"x":1792192320000,"y":7.6},{"x":1792192380000,"y":7.5},{"x":1792192440000,"y":7.5},{"x":1792192500000,"y":7.5},{"x":1792192560000,"y":7.5},{"x":1792192620000,"y":7.5},{"x":1792192680000,"y":7.6},{"x":1792192740000,"y":7.6},{"x":1792192800000,"y":7.7},{"x":1792192860000,"y":7.8},{"x":1792192920000,"y":7.9},{"x":1792192980000,"y":7.8},{"x":1792193040000,"y":7.8},{"x":1792193100000,"y":7.9},{"x":1792193160000,"y":7.9},{"x":1792193220000,"y":7.9},{"x":1792193280000,"y":8.1},{"x":1792193340000,"y":8.4},{"x":1792193400000,"y":8.5},{"x":1792193460000,"y":8.2},{"x":1792193520000,"y":7.9},{"x":1792193580000,"y":7.9},{"x":1792193640000,"y":7.9},{"x":1792193700000,"y":7.8},{"x":1792193760000,"y":8},{"x":1792193820000,"y":8.2},{"x":1792193880000,"y":8.2},{"x":1792193940000,"y":8.4},{"x":1792194000000,"y":8.5},{"x":1792194060000,"y":8.6},{"x":1792194120000,"y":8.9},{"x":1792194180000,"y":8.9},{"x":1792194240000,"y":9},{"x":1792194300000,"y":9.2},{"x":1792194360000,"y":9.1},{"x":1792194420000,"y":9},{"x":1792194480000,"y":9},{"x":1792194540000,"y":9},{"x":1792194600000,"y":8.9},{"x":1792194660000,"y":8.8},{"x":1792194720000,"y":8.8},{"x":1792194780000,"y":8.8},{"x":1792194840000,"y":8.7},{"x":1792194900000,"y":8.2},{"x":1792194960000,"y":8.1},{"x":1792195020000,"y":7.8},{"x":1792195080000,"y":7.8},{"x":1792195140000,"y":8},{"x":1792195200000,"y":8.1},{"x":1792195260000,"y":8.2},{"x":1792195320000,"y":8.3},{"x":1792195380000,"y":8.4},{"x":1792195440000,"y":8.6},{"x":1792195500000,"y":8.9},{"x":1792195560000,"y":9},{"x":1792195620000,"y":9.2},{"x":1792195680000,"y":9.3},{"x":1792195740000,"y":9.1},{"x":1792195800000,"y":9.2},{"x":1792195860000,"y":9.2},{"x":1792195920000,"y":9.2},{"x":1792195980000,"y":9.3},{"x":1792196040000,"y":9.3},{"x":1792196100000,"y":9.4},{"x":1792196160000,"y":9.3},{"x":1792196220000,"y":9.5},{"x":1792196280000,"y":9.5},{"x":1792196340000,"y":9.4},{"x":1792196400000,"y":9.5},{"x":1792196460000,"y":9.4},{"x":1792196520000,"y":9.4},{"x":1792196580000,"y":9.3},{"x":1792196640000,"y":9.2},{"x":1792196700000,"y":9.1},{"x":1792196760000,"y":9},{"x":1792196820000,"y":8.9},{"x":1792196880000,"y":8.9},{"x":1792196940000,"y":8.9},{"x":1792197000000,"y":8.7},{"x":1792197060000,"y":8.3},{"x":1792197120000,"y":7.9},{"x":1792197180000,"y":7.6},{"x":1792197240000,"y":7.4},{"x":1792197300000,"y":7.5},{"x":1792197360000,"y":7.6},{"x":1792197420000,"y":7.8},{"x":1792197480000,"y":7.9},{"x":1792197540000,"y":8.2},{"x":1792197600000,"y":8.5},{"x":1792197660000,"y":8.6},{"x":1792197720000,"y":8.9},{"x":1792197780000,"y":9.1},{"x":1792197840000,"y":9.2},{"x":1792197900000,"y":9.2},{"x":1792197960000,"y":9.2},{"x":1792198020000,"y":9.4},{"x":1792198080000,"y":9.3},{"x":1792198140000,"y":9.3},{"x":1792198200000,"y":9.4},{"x":1792198260000,"y":9.4},{"x":1792198320000,"y":9.6},{"x":1792198380000,"y":9.4},{"x":1792198440000,"y":9.4},{"x":1792198500000,"y":9.5},{"x":1792198560000,"y":9.5},{"x":1792198620000,"y":9.5},{"x":1792198680000,"y":9.5},{"x":1792198740000,"y":9.5},{"x":1792198800000,"y":9.6},{"x":1792198860000,"y":9.6},{"x":1792198920000,"y":9.6},{"x":1792198980000,"y":9.6},{"x":1792199040000,"y":9.5},{"x":1792199100000,"y":9.4},{"x":1792199160000,"y":9.4},{"x":1792199220000,"y":9.5},{"x":1792199280000,"y":9.5},{"x":1792199340000,"y":9.6},{"x":1792199400000,"y":9.6},{"x":1792199460000,"y":9.5},{"x":1792199520000,"y":9.7},{"x":1792199580000,"y":9.7},{"x":1792199640000,"y":9.6},{"x":1792199700000,"y":9.5},{"x":1792199760000,"y":9.6},{"x":1792199820000,"y":9.6},{"x":1792199880000,"y":9.4},{"x":1792199940000,"y":9.4},{"x":1792200000000,"y":9.5},{"x":1792200060000,"y":9.5},{"x":1792200120000,"y":9.5},{"x":1792200180000,"y":9.5},{"x":1792200240000,"y":9.4},{"x":1792200300000,"y":9.2},{"x":1792200360000,"y":9},{"x":1792200420000,"y":8.8},{"x":1792200480000,"y":8.7},{"x":1792200540000,"y":8.8},{"x":1792200600000,"y":8.7},{"x":1792200660000,"y":8.7},{"x":1792200720000,"y":8.6},{"x":1792200780000,"y":8.4},{"x":1792200840000,"y":8.3},{"x":1792200900000,"y":8.3},{"x":1792200960000,"y":8.4},{"x":1792201020000,"y":8.4},{"x":1792201080000,"y":8.6},{"x":1792201140000,"y":8.6},{"x":1792201200000,"y":8},{"x":1792201260000,"y":8.2},{"x":1792201320000,"y":8.5},{"x":1792201380000,"y":8.7},{"x":1792201440000,"y":8.2},{"x":1792201500000,"y":7.8},{"x":1792201560000,"y":7.4},{"x":1792201620000,"y":7},{"x":1792201680000,"y":6.8},{"x":1792201740000,"y":6.7},{"x":1792201800000,"y":6.7},{"x":1792201860000,"y":6.7},{"x":1792201920000,"y":6.8},{"x":1792201980000,"y":6.9},{"x":1792202040000,"y":6.9},{"x":1792202100000,"y":6.9},{"x":1792202160000,"y":6.9},{"x":1792202220000,"y":7},{"x":1792202280000,"y":7.2},{"x":1792202340000,"y":7.2},{"x":1792202400000,"y":7.3},{"x":1792202460000,"y":7.3},{"x":1792202520000,"y":7.2},{"x":1792202580000,"y":7.6},{"x":1792202640000,"y":7.8},{"x":1792202700000,"y":7.9},{"x":1792202760000,"y":7.8},{"x":1792202820000,"y":7.8},{"x":1792202880000,"y":8.1},{"x":1792202940000,"y":8},{"x":1792203000000,"y":7.9},{"x":1792203060000,"y":7.9},{"x":1792203120000,"y":8.1},{"x":1792203180000,"y":8},{"x":1792203240000,"y":7.9},{"x":1792203300000,"y":7.9},{"x":1792203360000,"y":7.9},{"x":1792203420000,"y":8},{"x":1792203480000,"y":7.9},{"x":1792203540000,"y":7.9},{"x":1792203600000,"y":8},{"x":1792203660000,"y":8},{"x":1792203720000,"y":8.1},{"x":1792203780000,"y":8.1},{"x":1792203840000,"y":8.2},{"x":1792203900000,"y":8.1},{"x":1792203960000,"y":8},{"x":1792204020000,"y":7.7},{"x":1792204080000,"y":7.7},{"x":1792204140000,"y":7.8},{"x":1792204200000,"y":7.7},{"x":1792204260000,"y":7.7},{"x":1792204320000,"y":7.7},{"x":1792204380000,"y":7.8},{"x":1792204440000,"y":7.8},{"x":1792204500000,"y":7.8},{"x":1792204560000,"y":7.8},{"x":1792204620000,"y":7.7},{"x":1792204680000,"y":7.7},{"x":1792204740000,"y":7.7},{"x":1792204800000,"y":7.7},{"x":1792204860000,"y":7.7},{"x":1792204920000,"y":7.7},{"x":1792204980000,"y":7.7},{"x":1792205040000,"y":7.7},{"x":1792205100000,"y":7.7}],"highlightExtremes":true,"unit":" °C"},{"label":"Rosný bod (°C)","color":"#5b9f4a","points":[],"highlightExtremes":false,"unit":" °C"}], {"yLabel":"\u00b0C"}); }); $(document).ready(function() { buildMeteoChart('chart-rain-canvas', 'chart-rain-reset', [{"label":"Zrážky (mm)","color":"#008fbf","points":[{"x":1792188000000,"y":0},{"x":1792188060000,"y":0},{"x":1792188120000,"y":0},{"x":1792188180000,"y":0},{"x":1792188240000,"y":0},{"x":1792188300000,"y":0},{"x":1792188360000,"y":0},{"x":1792188420000,"y":0},{"x":1792188480000,"y":0},{"x":1792188540000,"y":0},{"x":1792188600000,"y":0},{"x":1792188660000,"y":0},{"x":1792188720000,"y":0},{"x":1792188780000,"y":0},{"x":1792188840000,"y":0},{"x":1792188900000,"y":0},{"x":1792188960000,"y":0},{"x":1792189020000,"y":0},{"x":1792189080000,"y":0},{"x":1792189140000,"y":0},{"x":1792189200000,"y":0},{"x":1792189260000,"y":0},{"x":1792189320000,"y":0},{"x":1792189380000,"y":0},{"x":1792189440000,"y":0},{"x":1792189500000,"y":0},{"x":1792189560000,"y":0},{"x":1792189620000,"y":0},{"x":1792189680000,"y":0},{"x":1792189740000,"y":0},{"x":1792189800000,"y":0},{"x":1792189860000,"y":0},{"x":1792189920000,"y":0},{"x":1792189980000,"y":0},{"x":1792190040000,"y":0},{"x":1792190100000,"y":0},{"x":1792190160000,"y":0},{"x":1792190220000,"y":0},{"x":1792190280000,"y":0},{"x":1792190340000,"y":0},{"x":1792190400000,"y":0},{"x":1792190460000,"y":0},{"x":1792190520000,"y":0},{"x":1792190580000,"y":0},{"x":1792190640000,"y":0},{"x":1792190700000,"y":0},{"x":1792190760000,"y":0},{"x":1792190820000,"y":0},{"x":1792190880000,"y":0},{"x":1792190940000,"y":0},{"x":1792191000000,"y":0},{"x":1792191060000,"y":0},{"x":1792191120000,"y":0},{"x":1792191180000,"y":0},{"x":1792191240000,"y":0},{"x":1792191300000,"y":0},{"x":1792191360000,"y":0},{"x":1792191420000,"y":0},{"x":1792191480000,"y":0},{"x":1792191540000,"y":0},{"x":1792191600000,"y":0},{"x":1792191660000,"y":0},{"x":1792191720000,"y":0},{"x":1792191780000,"y":0},{"x":1792191840000,"y":0},{"x":1792191900000,"y":0},{"x":1792191960000,"y":0},{"x":1792192020000,"y":0},{"x":1792192080000,"y":0},{"x":1792192140000,"y":0},{"x":1792192200000,"y":0},{"x":1792192260000,"y":0},{"x":1792192320000,"y":0},{"x":1792192380000,"y":0},{"x":1792192440000,"y":0},{"x":1792192500000,"y":0},{"x":1792192560000,"y":0},{"x":1792192620000,"y":0},{"x":1792192680000,"y":0},{"x":1792192740000,"y":0},{"x":1792192800000,"y":0},{"x":1792192860000,"y":0},{"x":1792192920000,"y":0},{"x":1792192980000,"y":0},{"x":1792193040000,"y":0},{"x":1792193100000,"y":0},{"x":1792193160000,"y":0},{"x":1792193220000,"y":0},{"x":1792193280000,"y":0},{"x":1792193340000,"y":0},{"x":1792193400000,"y":0},{"x":1792193460000,"y":0},{"x":1792193520000,"y":0},{"x":1792193580000,"y":0},{"x":1792193640000,"y":0},{"x":1792193700000,"y":0},{"x":1792193760000,"y":0},{"x":1792193820000,"y":0},{"x":1792193880000,"y":0},{"x":1792193940000,"y":0},{"x":1792194000000,"y":0},{"x":1792194060000,"y":0},{"x":1792194120000,"y":0},{"x":1792194180000,"y":0},{"x":1792194240000,"y":0},{"x":1792194300000,"y":0},{"x":1792194360000,"y":0},{"x":1792194420000,"y":0},{"x":1792194480000,"y":0},{"x":1792194540000,"y":0},{"x":1792194600000,"y":0},{"x":1792194660000,"y":0},{"x":1792194720000,"y":0},{"x":1792194780000,"y":0},{"x":1792194840000,"y":0},{"x":1792194900000,"y":0},{"x":1792194960000,"y":0},{"x":1792195020000,"y":0},{"x":1792195080000,"y":0},{"x":1792195140000,"y":0},{"x":1792195200000,"y":0},{"x":1792195260000,"y":0},{"x":1792195320000,"y":0},{"x":1792195380000,"y":0},{"x":1792195440000,"y":0},{"x":1792195500000,"y":0},{"x":1792195560000,"y":0},{"x":1792195620000,"y":0},{"x":1792195680000,"y":0},{"x":1792195740000,"y":0},{"x":1792195800000,"y":0},{"x":1792195860000,"y":0},{"x":1792195920000,"y":0},{"x":1792195980000,"y":0},{"x":1792196040000,"y":0},{"x":1792196100000,"y":0},{"x":1792196160000,"y":0},{"x":1792196220000,"y":0},{"x":1792196280000,"y":0},{"x":1792196340000,"y":0},{"x":1792196400000,"y":0},{"x":1792196460000,"y":0},{"x":1792196520000,"y":0},{"x":1792196580000,"y":0},{"x":1792196640000,"y":0},{"x":1792196700000,"y":0},{"x":1792196760000,"y":0},{"x":1792196820000,"y":0},{"x":1792196880000,"y":0},{"x":1792196940000,"y":0},{"x":1792197000000,"y":0},{"x":1792197060000,"y":0},{"x":1792197120000,"y":0},{"x":1792197180000,"y":0},{"x":1792197240000,"y":0},{"x":1792197300000,"y":0},{"x":1792197360000,"y":0},{"x":1792197420000,"y":0},{"x":1792197480000,"y":0},{"x":1792197540000,"y":0},{"x":1792197600000,"y":0},{"x":1792197660000,"y":0},{"x":1792197720000,"y":0},{"x":1792197780000,"y":0},{"x":1792197840000,"y":0},{"x":1792197900000,"y":0},{"x":1792197960000,"y":0},{"x":1792198020000,"y":0},{"x":1792198080000,"y":0},{"x":1792198140000,"y":0},{"x":1792198200000,"y":0},{"x":1792198260000,"y":0},{"x":1792198320000,"y":0},{"x":1792198380000,"y":0},{"x":1792198440000,"y":0},{"x":1792198500000,"y":0},{"x":1792198560000,"y":0},{"x":1792198620000,"y":0},{"x":1792198680000,"y":0},{"x":1792198740000,"y":0},{"x":1792198800000,"y":0},{"x":1792198860000,"y":0},{"x":1792198920000,"y":0},{"x":1792198980000,"y":0},{"x":1792199040000,"y":0},{"x":1792199100000,"y":0},{"x":1792199160000,"y":0},{"x":1792199220000,"y":0},{"x":1792199280000,"y":0},{"x":1792199340000,"y":0},{"x":1792199400000,"y":0},{"x":1792199460000,"y":0},{"x":1792199520000,"y":0},{"x":1792199580000,"y":0},{"x":1792199640000,"y":0},{"x":1792199700000,"y":0},{"x":1792199760000,"y":0},{"x":1792199820000,"y":0},{"x":1792199880000,"y":0},{"x":1792199940000,"y":0},{"x":1792200000000,"y":0},{"x":1792200060000,"y":0},{"x":1792200120000,"y":0},{"x":1792200180000,"y":0},{"x":1792200240000,"y":0},{"x":1792200300000,"y":0},{"x":1792200360000,"y":0},{"x":1792200420000,"y":0},{"x":1792200480000,"y":0},{"x":1792200540000,"y":0},{"x":1792200600000,"y":0},{"x":1792200660000,"y":0},{"x":1792200720000,"y":0},{"x":1792200780000,"y":0},{"x":1792200840000,"y":0},{"x":1792200900000,"y":0},{"x":1792200960000,"y":0},{"x":1792201020000,"y":0},{"x":1792201080000,"y":0},{"x":1792201140000,"y":0},{"x":1792201200000,"y":0},{"x":1792201260000,"y":0},{"x":1792201320000,"y":0},{"x":1792201380000,"y":0},{"x":1792201440000,"y":0},{"x":1792201500000,"y":0},{"x":1792201560000,"y":0},{"x":1792201620000,"y":0},{"x":1792201680000,"y":0},{"x":1792201740000,"y":0},{"x":1792201800000,"y":0},{"x":1792201860000,"y":0},{"x":1792201920000,"y":0},{"x":1792201980000,"y":0},{"x":1792202040000,"y":0},{"x":1792202100000,"y":0},{"x":1792202160000,"y":0},{"x":1792202220000,"y":0},{"x":1792202280000,"y":0},{"x":1792202340000,"y":0},{"x":1792202400000,"y":0},{"x":1792202460000,"y":0},{"x":1792202520000,"y":0},{"x":1792202580000,"y":0},{"x":1792202640000,"y":0},{"x":1792202700000,"y":0},{"x":1792202760000,"y":0},{"x":1792202820000,"y":0},{"x":1792202880000,"y":0},{"x":1792202940000,"y":0},{"x":1792203000000,"y":0},{"x":1792203060000,"y":0},{"x":1792203120000,"y":0},{"x":1792203180000,"y":0},{"x":1792203240000,"y":0},{"x":1792203300000,"y":0},{"x":1792203360000,"y":0},{"x":1792203420000,"y":0},{"x":1792203480000,"y":0},{"x":1792203540000,"y":0},{"x":1792203600000,"y":0},{"x":1792203660000,"y":0},{"x":1792203720000,"y":0},{"x":1792203780000,"y":0},{"x":1792203840000,"y":0},{"x":1792203900000,"y":0},{"x":1792203960000,"y":0},{"x":1792204020000,"y":0},{"x":1792204080000,"y":0},{"x":1792204140000,"y":0},{"x":1792204200000,"y":0},{"x":1792204260000,"y":0},{"x":1792204320000,"y":0},{"x":1792204380000,"y":0},{"x":1792204440000,"y":0},{"x":1792204500000,"y":0},{"x":1792204560000,"y":0},{"x":1792204620000,"y":0},{"x":1792204680000,"y":0},{"x":1792204740000,"y":0},{"x":1792204800000,"y":0},{"x":1792204860000,"y":0},{"x":1792204920000,"y":0},{"x":1792204980000,"y":0},{"x":1792205040000,"y":0},{"x":1792205100000,"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; }