var meteoCharts = {}; var meteoCompassLabels = {0: 'S', 90: 'V', 180: 'J', 270: 'Z', 360: 'S'}; var meteoRangeMin = 1794006000000; var meteoRangeMax = 1794023050000; 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":1794006000000,"y":1.1},{"x":1794006060000,"y":1},{"x":1794006120000,"y":1.1},{"x":1794006180000,"y":1.3},{"x":1794006240000,"y":1.5},{"x":1794006300000,"y":1.7},{"x":1794006360000,"y":2.1},{"x":1794006420000,"y":2.3},{"x":1794006480000,"y":2.7},{"x":1794006540000,"y":2.9},{"x":1794006600000,"y":2.8},{"x":1794006660000,"y":2.8},{"x":1794006720000,"y":2.8},{"x":1794006780000,"y":2.9},{"x":1794006840000,"y":2.8},{"x":1794006900000,"y":2.8},{"x":1794006960000,"y":2.6},{"x":1794007020000,"y":3.3},{"x":1794007080000,"y":3.4},{"x":1794007140000,"y":3.2},{"x":1794007200000,"y":3.2},{"x":1794007260000,"y":3.5},{"x":1794007320000,"y":3.4},{"x":1794007380000,"y":3.1},{"x":1794007440000,"y":2.9},{"x":1794007500000,"y":3.3},{"x":1794007560000,"y":3.2},{"x":1794007620000,"y":2.9},{"x":1794007680000,"y":2.8},{"x":1794007740000,"y":3.2},{"x":1794007800000,"y":3.6},{"x":1794007860000,"y":3.7},{"x":1794007920000,"y":3.7},{"x":1794007980000,"y":3.4},{"x":1794008040000,"y":3.3},{"x":1794008100000,"y":3},{"x":1794008160000,"y":3.5},{"x":1794008220000,"y":3.6},{"x":1794008280000,"y":3.3},{"x":1794008340000,"y":3.3},{"x":1794008400000,"y":3.5},{"x":1794008460000,"y":3.5},{"x":1794008520000,"y":3.6},{"x":1794008580000,"y":3.7},{"x":1794008640000,"y":3.6},{"x":1794008700000,"y":3.6},{"x":1794008760000,"y":3.7},{"x":1794008820000,"y":3.4},{"x":1794008880000,"y":3.8},{"x":1794008940000,"y":3.9},{"x":1794009000000,"y":3.9},{"x":1794009060000,"y":3.7},{"x":1794009120000,"y":3.6},{"x":1794009180000,"y":3.4},{"x":1794009240000,"y":3.7},{"x":1794009300000,"y":3.9},{"x":1794009360000,"y":3.8},{"x":1794009420000,"y":3.7},{"x":1794009480000,"y":3.7},{"x":1794009540000,"y":3.5},{"x":1794009600000,"y":3.2},{"x":1794009660000,"y":3.3},{"x":1794009720000,"y":3.3},{"x":1794009780000,"y":3.2},{"x":1794009840000,"y":3},{"x":1794009900000,"y":3.6},{"x":1794009960000,"y":3.7},{"x":1794010020000,"y":3.8},{"x":1794010080000,"y":3.9},{"x":1794010140000,"y":3.9},{"x":1794010200000,"y":3.4},{"x":1794010260000,"y":3.7},{"x":1794010320000,"y":4},{"x":1794010380000,"y":4},{"x":1794010440000,"y":4.1},{"x":1794010500000,"y":4.2},{"x":1794010560000,"y":4.2},{"x":1794010620000,"y":4},{"x":1794010680000,"y":3.8},{"x":1794010740000,"y":3.7},{"x":1794010800000,"y":3.7},{"x":1794010860000,"y":3.8},{"x":1794010920000,"y":4},{"x":1794010980000,"y":4.2},{"x":1794011040000,"y":4.1},{"x":1794011100000,"y":4},{"x":1794011160000,"y":3.9},{"x":1794011220000,"y":4.1},{"x":1794011280000,"y":4},{"x":1794011340000,"y":3.7},{"x":1794011400000,"y":3.6},{"x":1794011460000,"y":3.6},{"x":1794011520000,"y":3.8},{"x":1794011580000,"y":3.8},{"x":1794011640000,"y":3.7},{"x":1794011700000,"y":3.5},{"x":1794011760000,"y":3.7},{"x":1794011820000,"y":3.7},{"x":1794011880000,"y":3.7},{"x":1794011940000,"y":3.7},{"x":1794012000000,"y":3.9},{"x":1794012060000,"y":3.9},{"x":1794012120000,"y":4},{"x":1794012180000,"y":3.9},{"x":1794012240000,"y":3.8},{"x":1794012300000,"y":3.9},{"x":1794012360000,"y":3.9},{"x":1794012420000,"y":3.9},{"x":1794012480000,"y":3.6},{"x":1794012540000,"y":3.6},{"x":1794012600000,"y":3.5},{"x":1794012660000,"y":3.8},{"x":1794012720000,"y":3.8},{"x":1794012780000,"y":3.8},{"x":1794012840000,"y":3.6},{"x":1794012900000,"y":3.6},{"x":1794012960000,"y":3.5},{"x":1794013020000,"y":3.5},{"x":1794013080000,"y":3.6},{"x":1794013140000,"y":3.6},{"x":1794013200000,"y":3.8},{"x":1794013260000,"y":3.7},{"x":1794013320000,"y":3.6},{"x":1794013380000,"y":3.6},{"x":1794013440000,"y":3.8},{"x":1794013500000,"y":3.7},{"x":1794013560000,"y":4},{"x":1794013620000,"y":4.2},{"x":1794013680000,"y":4.1},{"x":1794013740000,"y":3.9},{"x":1794013800000,"y":4},{"x":1794013860000,"y":3.8},{"x":1794013920000,"y":3.9},{"x":1794013980000,"y":4},{"x":1794014040000,"y":3.9},{"x":1794014100000,"y":3.9},{"x":1794014160000,"y":3.8},{"x":1794014220000,"y":3.8},{"x":1794014280000,"y":3.7},{"x":1794014340000,"y":3.7},{"x":1794014400000,"y":3.7},{"x":1794014460000,"y":3.8},{"x":1794014520000,"y":4},{"x":1794014580000,"y":3.8},{"x":1794014640000,"y":3.7},{"x":1794014700000,"y":3.8},{"x":1794014760000,"y":4.1},{"x":1794014820000,"y":4.1},{"x":1794014880000,"y":4.2},{"x":1794014940000,"y":4.1},{"x":1794015000000,"y":4},{"x":1794015060000,"y":4.1},{"x":1794015120000,"y":4.5},{"x":1794015180000,"y":4.8},{"x":1794015240000,"y":4.6},{"x":1794015300000,"y":4.4},{"x":1794015360000,"y":4},{"x":1794015420000,"y":4.2},{"x":1794015480000,"y":4.2},{"x":1794015540000,"y":4.1},{"x":1794015600000,"y":4},{"x":1794015660000,"y":3.8},{"x":1794015720000,"y":3.6},{"x":1794015780000,"y":3.4},{"x":1794015840000,"y":3.6},{"x":1794015900000,"y":3.7},{"x":1794015960000,"y":3.6},{"x":1794016020000,"y":3.8},{"x":1794016080000,"y":3.4},{"x":1794016140000,"y":3.7},{"x":1794016200000,"y":3.8},{"x":1794016260000,"y":3.9},{"x":1794016320000,"y":4.1},{"x":1794016380000,"y":4.1},{"x":1794016440000,"y":4.2},{"x":1794016500000,"y":4.4},{"x":1794016560000,"y":4.3},{"x":1794016620000,"y":4.1},{"x":1794016680000,"y":4.2},{"x":1794016740000,"y":4.2},{"x":1794016800000,"y":4.2},{"x":1794016860000,"y":4.1},{"x":1794016920000,"y":3.8},{"x":1794016980000,"y":3.8},{"x":1794017040000,"y":3.6},{"x":1794017100000,"y":3.7},{"x":1794017160000,"y":3.7},{"x":1794017220000,"y":3.9},{"x":1794017280000,"y":3.9},{"x":1794017340000,"y":4},{"x":1794017400000,"y":3.8},{"x":1794017460000,"y":3.7},{"x":1794017520000,"y":3.3},{"x":1794017580000,"y":3},{"x":1794017640000,"y":2.9},{"x":1794017700000,"y":3},{"x":1794017760000,"y":3},{"x":1794017820000,"y":3},{"x":1794017880000,"y":2.9},{"x":1794017940000,"y":3.1},{"x":1794018000000,"y":3.2},{"x":1794018060000,"y":3.3},{"x":1794018120000,"y":3.2},{"x":1794018180000,"y":3.2},{"x":1794018240000,"y":3.2},{"x":1794018300000,"y":3.3},{"x":1794018360000,"y":3.2},{"x":1794018420000,"y":3},{"x":1794018480000,"y":2.9},{"x":1794018540000,"y":3},{"x":1794018600000,"y":3.1},{"x":1794018660000,"y":3.5},{"x":1794018720000,"y":3.6},{"x":1794018780000,"y":3.5},{"x":1794018840000,"y":3.3},{"x":1794018900000,"y":3.3},{"x":1794018960000,"y":3.4},{"x":1794019020000,"y":3.5},{"x":1794019080000,"y":3.7},{"x":1794019140000,"y":3.5},{"x":1794019200000,"y":3.6},{"x":1794019260000,"y":3.7},{"x":1794019320000,"y":3.6},{"x":1794019380000,"y":3.5},{"x":1794019440000,"y":3.5},{"x":1794019500000,"y":3.3},{"x":1794019560000,"y":3.3},{"x":1794019620000,"y":3.4},{"x":1794019680000,"y":3.4},{"x":1794019740000,"y":3.2},{"x":1794019800000,"y":3.5},{"x":1794019860000,"y":3.4},{"x":1794019920000,"y":3.3},{"x":1794019980000,"y":3.4},{"x":1794020040000,"y":3.3},{"x":1794020100000,"y":3.2},{"x":1794020160000,"y":3.1},{"x":1794020220000,"y":3.1},{"x":1794020280000,"y":3.3},{"x":1794020340000,"y":3.6},{"x":1794020400000,"y":3.6},{"x":1794020460000,"y":3.7},{"x":1794020520000,"y":3.7},{"x":1794020580000,"y":3.6},{"x":1794020640000,"y":3.4},{"x":1794020700000,"y":3.3},{"x":1794020760000,"y":3.5},{"x":1794020820000,"y":3.2},{"x":1794020880000,"y":3.1},{"x":1794020940000,"y":3.1},{"x":1794021000000,"y":3.3},{"x":1794021060000,"y":3.5},{"x":1794021120000,"y":3.5},{"x":1794021180000,"y":3.4},{"x":1794021240000,"y":3.1},{"x":1794021300000,"y":3.2},{"x":1794021360000,"y":3.4},{"x":1794021420000,"y":3.4},{"x":1794021480000,"y":3.4},{"x":1794021540000,"y":3.3},{"x":1794021600000,"y":3.2},{"x":1794021660000,"y":3.2},{"x":1794021720000,"y":3.3},{"x":1794021780000,"y":3.2},{"x":1794021840000,"y":3.2},{"x":1794021900000,"y":3.6},{"x":1794021960000,"y":3.6},{"x":1794022020000,"y":3.5},{"x":1794022080000,"y":3.3},{"x":1794022140000,"y":3.3},{"x":1794022200000,"y":3.3},{"x":1794022260000,"y":3.3},{"x":1794022320000,"y":3.5},{"x":1794022380000,"y":3.7},{"x":1794022440000,"y":3.6},{"x":1794022500000,"y":3.6},{"x":1794022560000,"y":3.7},{"x":1794022620000,"y":3.7},{"x":1794022680000,"y":3.6}],"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":1794006000000,"y":0},{"x":1794006060000,"y":0},{"x":1794006120000,"y":0},{"x":1794006180000,"y":0},{"x":1794006240000,"y":0},{"x":1794006300000,"y":0},{"x":1794006360000,"y":0},{"x":1794006420000,"y":0},{"x":1794006480000,"y":0},{"x":1794006540000,"y":0},{"x":1794006600000,"y":0},{"x":1794006660000,"y":0},{"x":1794006720000,"y":0},{"x":1794006780000,"y":0},{"x":1794006840000,"y":0},{"x":1794006900000,"y":0},{"x":1794006960000,"y":0},{"x":1794007020000,"y":0},{"x":1794007080000,"y":0},{"x":1794007140000,"y":0},{"x":1794007200000,"y":0},{"x":1794007260000,"y":0},{"x":1794007320000,"y":0},{"x":1794007380000,"y":0},{"x":1794007440000,"y":0},{"x":1794007500000,"y":0},{"x":1794007560000,"y":0},{"x":1794007620000,"y":0},{"x":1794007680000,"y":0},{"x":1794007740000,"y":0},{"x":1794007800000,"y":0},{"x":1794007860000,"y":0},{"x":1794007920000,"y":0},{"x":1794007980000,"y":0},{"x":1794008040000,"y":0},{"x":1794008100000,"y":0},{"x":1794008160000,"y":0},{"x":1794008220000,"y":0},{"x":1794008280000,"y":0},{"x":1794008340000,"y":0},{"x":1794008400000,"y":0},{"x":1794008460000,"y":0},{"x":1794008520000,"y":0},{"x":1794008580000,"y":0},{"x":1794008640000,"y":0},{"x":1794008700000,"y":0},{"x":1794008760000,"y":0},{"x":1794008820000,"y":0},{"x":1794008880000,"y":0},{"x":1794008940000,"y":0},{"x":1794009000000,"y":0},{"x":1794009060000,"y":0},{"x":1794009120000,"y":0},{"x":1794009180000,"y":0},{"x":1794009240000,"y":0},{"x":1794009300000,"y":0},{"x":1794009360000,"y":0},{"x":1794009420000,"y":0},{"x":1794009480000,"y":0},{"x":1794009540000,"y":0},{"x":1794009600000,"y":0},{"x":1794009660000,"y":0},{"x":1794009720000,"y":0},{"x":1794009780000,"y":0},{"x":1794009840000,"y":0},{"x":1794009900000,"y":0},{"x":1794009960000,"y":0},{"x":1794010020000,"y":0},{"x":1794010080000,"y":0},{"x":1794010140000,"y":0},{"x":1794010200000,"y":0},{"x":1794010260000,"y":0},{"x":1794010320000,"y":0},{"x":1794010380000,"y":0},{"x":1794010440000,"y":0},{"x":1794010500000,"y":0},{"x":1794010560000,"y":0},{"x":1794010620000,"y":0},{"x":1794010680000,"y":0},{"x":1794010740000,"y":0},{"x":1794010800000,"y":0},{"x":1794010860000,"y":0},{"x":1794010920000,"y":0},{"x":1794010980000,"y":0},{"x":1794011040000,"y":0},{"x":1794011100000,"y":0},{"x":1794011160000,"y":0},{"x":1794011220000,"y":0},{"x":1794011280000,"y":0},{"x":1794011340000,"y":0},{"x":1794011400000,"y":0},{"x":1794011460000,"y":0},{"x":1794011520000,"y":0},{"x":1794011580000,"y":0},{"x":1794011640000,"y":0},{"x":1794011700000,"y":0},{"x":1794011760000,"y":0},{"x":1794011820000,"y":0},{"x":1794011880000,"y":0},{"x":1794011940000,"y":0},{"x":1794012000000,"y":0},{"x":1794012060000,"y":0},{"x":1794012120000,"y":0},{"x":1794012180000,"y":0},{"x":1794012240000,"y":0},{"x":1794012300000,"y":0},{"x":1794012360000,"y":0},{"x":1794012420000,"y":0},{"x":1794012480000,"y":0},{"x":1794012540000,"y":0},{"x":1794012600000,"y":0},{"x":1794012660000,"y":0},{"x":1794012720000,"y":0},{"x":1794012780000,"y":0},{"x":1794012840000,"y":0},{"x":1794012900000,"y":0},{"x":1794012960000,"y":0},{"x":1794013020000,"y":0},{"x":1794013080000,"y":0},{"x":1794013140000,"y":0},{"x":1794013200000,"y":0},{"x":1794013260000,"y":0},{"x":1794013320000,"y":0},{"x":1794013380000,"y":0},{"x":1794013440000,"y":0},{"x":1794013500000,"y":0},{"x":1794013560000,"y":0},{"x":1794013620000,"y":0},{"x":1794013680000,"y":0},{"x":1794013740000,"y":0},{"x":1794013800000,"y":0},{"x":1794013860000,"y":0},{"x":1794013920000,"y":0},{"x":1794013980000,"y":0},{"x":1794014040000,"y":0},{"x":1794014100000,"y":0},{"x":1794014160000,"y":0},{"x":1794014220000,"y":0},{"x":1794014280000,"y":0},{"x":1794014340000,"y":0},{"x":1794014400000,"y":0},{"x":1794014460000,"y":0},{"x":1794014520000,"y":0},{"x":1794014580000,"y":0},{"x":1794014640000,"y":0},{"x":1794014700000,"y":0},{"x":1794014760000,"y":0},{"x":1794014820000,"y":0},{"x":1794014880000,"y":0},{"x":1794014940000,"y":0},{"x":1794015000000,"y":0},{"x":1794015060000,"y":0},{"x":1794015120000,"y":0},{"x":1794015180000,"y":0},{"x":1794015240000,"y":0},{"x":1794015300000,"y":0},{"x":1794015360000,"y":0},{"x":1794015420000,"y":0},{"x":1794015480000,"y":0},{"x":1794015540000,"y":0},{"x":1794015600000,"y":0},{"x":1794015660000,"y":0},{"x":1794015720000,"y":0},{"x":1794015780000,"y":0},{"x":1794015840000,"y":0},{"x":1794015900000,"y":0},{"x":1794015960000,"y":0},{"x":1794016020000,"y":0},{"x":1794016080000,"y":0},{"x":1794016140000,"y":0},{"x":1794016200000,"y":0},{"x":1794016260000,"y":0},{"x":1794016320000,"y":0},{"x":1794016380000,"y":0},{"x":1794016440000,"y":0},{"x":1794016500000,"y":0},{"x":1794016560000,"y":0},{"x":1794016620000,"y":0},{"x":1794016680000,"y":0},{"x":1794016740000,"y":0},{"x":1794016800000,"y":0},{"x":1794016860000,"y":0},{"x":1794016920000,"y":0},{"x":1794016980000,"y":0},{"x":1794017040000,"y":0},{"x":1794017100000,"y":0},{"x":1794017160000,"y":0},{"x":1794017220000,"y":0},{"x":1794017280000,"y":0},{"x":1794017340000,"y":0},{"x":1794017400000,"y":0},{"x":1794017460000,"y":0},{"x":1794017520000,"y":0},{"x":1794017580000,"y":0},{"x":1794017640000,"y":0},{"x":1794017700000,"y":0},{"x":1794017760000,"y":0},{"x":1794017820000,"y":0},{"x":1794017880000,"y":0},{"x":1794017940000,"y":0},{"x":1794018000000,"y":0},{"x":1794018060000,"y":0},{"x":1794018120000,"y":0},{"x":1794018180000,"y":0},{"x":1794018240000,"y":0},{"x":1794018300000,"y":0},{"x":1794018360000,"y":0},{"x":1794018420000,"y":0},{"x":1794018480000,"y":0},{"x":1794018540000,"y":0},{"x":1794018600000,"y":0},{"x":1794018660000,"y":0},{"x":1794018720000,"y":0},{"x":1794018780000,"y":0},{"x":1794018840000,"y":0},{"x":1794018900000,"y":0},{"x":1794018960000,"y":0},{"x":1794019020000,"y":0},{"x":1794019080000,"y":0},{"x":1794019140000,"y":0},{"x":1794019200000,"y":0},{"x":1794019260000,"y":0},{"x":1794019320000,"y":0},{"x":1794019380000,"y":0},{"x":1794019440000,"y":0},{"x":1794019500000,"y":0},{"x":1794019560000,"y":0},{"x":1794019620000,"y":0},{"x":1794019680000,"y":0},{"x":1794019740000,"y":0},{"x":1794019800000,"y":0},{"x":1794019860000,"y":0},{"x":1794019920000,"y":0},{"x":1794019980000,"y":0},{"x":1794020040000,"y":0},{"x":1794020100000,"y":0},{"x":1794020160000,"y":0},{"x":1794020220000,"y":0},{"x":1794020280000,"y":0},{"x":1794020340000,"y":0},{"x":1794020400000,"y":0},{"x":1794020460000,"y":0},{"x":1794020520000,"y":0},{"x":1794020580000,"y":0},{"x":1794020640000,"y":0},{"x":1794020700000,"y":0},{"x":1794020760000,"y":0},{"x":1794020820000,"y":0},{"x":1794020880000,"y":0},{"x":1794020940000,"y":0},{"x":1794021000000,"y":0},{"x":1794021060000,"y":0},{"x":1794021120000,"y":0},{"x":1794021180000,"y":0},{"x":1794021240000,"y":0},{"x":1794021300000,"y":0},{"x":1794021360000,"y":0},{"x":1794021420000,"y":0},{"x":1794021480000,"y":0},{"x":1794021540000,"y":0},{"x":1794021600000,"y":0},{"x":1794021660000,"y":0},{"x":1794021720000,"y":0},{"x":1794021780000,"y":0},{"x":1794021840000,"y":0},{"x":1794021900000,"y":0},{"x":1794021960000,"y":0},{"x":1794022020000,"y":0},{"x":1794022080000,"y":0},{"x":1794022140000,"y":0},{"x":1794022200000,"y":0},{"x":1794022260000,"y":0},{"x":1794022320000,"y":0},{"x":1794022380000,"y":0},{"x":1794022440000,"y":0},{"x":1794022500000,"y":0},{"x":1794022560000,"y":0},{"x":1794022620000,"y":0},{"x":1794022680000,"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; }