$("#baraLimba").hide();
$(window).on('load', function(){
setTimeout(removeLoader, 2000);
});
function removeLoader(){
$( '#loadingDiv' ).fadeOut(500, function() {
$( '#loadingDiv' ).remove();
});
}
var graficRezultate = function(chartData, chartOptions) {
var ctx = document.getElementById('myChart');
var myChart = new Chart(ctx, {
type: 'bar',
data: chartData,
options: chartOptions
});
};
var graficRezultateCompare = function(chartData, chartOptions) {
var ctx = document.getElementById('myChart2');
var myChart = new Chart(ctx, {
type: 'bar',
data: chartData,
options: chartOptions
});
};
var graficRezultateCompare2 = function(chartData, chartOptions) {
var ctx = document.getElementById('myChart3');
var myChart = new Chart(ctx, {
type: 'bar',
data: chartData,
options: chartOptions
});
};
var graficRezultateS = function(labels, values) {
var ctx = document.getElementById('myChart');
var color = Chart.helpers.color;
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
label: 'Temperature',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
pointRadius: 0,
fill: 'start',
data: values
}]
},
options: {
animation: false,
responsive: true,
legend: {
labels: {
boxWidth: 10
}
},
tooltips: {
mode: 'index',
intersect: false,
callbacks: {
label: function(tooltipItems, data) {
var label = data.datasets[tooltipItems.datasetIndex].label;
return label + ': ' + tooltipItems.yLabel + ' °C';
}
}
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
ticks: {
autoSkip: true
}
}],
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
};
var graficRezultateS1 = function(labels, values) {
var ctx = document.getElementById('myChart2');
var color = Chart.helpers.color;
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
label: 'Temperature',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
pointRadius: 0,
fill: 'start',
data: values
}]
},
options: {
animation: false,
responsive: true,
legend: {
labels: {
boxWidth: 10
}
},
tooltips: {
mode: 'index',
intersect: false,
callbacks: {
label: function(tooltipItems, data) {
var label = data.datasets[tooltipItems.datasetIndex].label;
return label + ': ' + tooltipItems.yLabel + ' °C';
}
}
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
ticks: {
autoSkip: true
}
}],
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
};
var graficRezultateS2 = function(labels, values) {
var ctx = document.getElementById('myChart3');
var color = Chart.helpers.color;
var myChart = new Chart(ctx, {
type: 'line',
data: {
labels: labels,
datasets: [{
label: 'Temperature',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
pointRadius: 0,
fill: 'start',
data: values
}]
},
options: {
animation: false,
responsive: true,
legend: {
labels: {
boxWidth: 10
}
},
tooltips: {
mode: 'index',
intersect: false,
callbacks: {
label: function(tooltipItems, data) {
var label = data.datasets[tooltipItems.datasetIndex].label;
return label + ': ' + tooltipItems.yLabel + ' °C';
}
}
},
hover: {
mode: 'nearest',
intersect: true
},
scales: {
xAxes: [{
ticks: {
autoSkip: true
}
}],
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
};
function titleCase(str) {
str = str.toLowerCase().split(' ');
for (var i = 0; i < str.length; i++) {
str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);
}
return str.join(' ');
}
$(function(){
$('#slider').slider({
max: 1,
min: 0,
value: 1,
step: 0.1
});
});
var neighbors;
var getsections = {};
var geojson;
window.onload = function () {
var neighbors
function styleSectii(feature) {
return {
fillColor: getColor(feature.properties.TYPE_RO),
weight: 0.9,
opacity: 1,
color: getColor(feature.properties.TYPE_RO),
dashArray: '0.5',
fillOpacity: $('#slider').slider('value')
};
}
function styleContur(feature) {
return {
fillColor: '#ffffff',
opacity: 1,
weight: 1,
color: '#000000',
dashArray: '0.5',
fillOpacity: 0
};
}
var optiuniSectiiPunct = {
radius: 2,
fillColor: '#000000',
color: '#000000',
weight: 1,
opacity: 1,
fillOpacity: 1,
pane: 'sectii_punct'
};
function styleFiecareVot(castigator) {
return {
radius: 1,
fillColor: getColor(castigator),
color: getColor(castigator),
fillOpacity: 1,
fill: true
}
}
function getColor(d) {
return d == 'munte' ? '#40407a' :
d == 'litoral' ? '#2980b9':
d == 'rural' ? '#f39c12':
'#ff5252';
}
var req = new XMLHttpRequest();
var url = 'data/locations_data.topojson';
req.open('GET', url, true);
req.onreadystatechange = handler;
req.send();
topoob = {};
getsections = {};
responseText = req.responseText
function parseTopoJSON(layer, style, onEachF, pane) {
topoob = JSON.parse(req.responseText)
neighbors = topojson.neighbors(topoob.objects[layer].geometries);
getsections = topojson.feature(topoob, topoob.objects[layer])
getsections.features = getsections.features.map(function(fm,i){
var ret = fm;
ret.indie = i;
return ret
});
content = L.geoJson(getsections, {style: style, onEachFeature: onEachF, pane: pane});
return content;
}
function parseTopoJSON2(layer, style, onEachF, pane) {
topoob = JSON.parse(req.responseText)
neighbors = topojson.neighbors(topoob.objects[layer].geometries);
getsections = topojson.feature(topoob, topoob.objects[layer])
getsections.features = getsections.features.map(function(fm,i){
var ret = fm;
ret.indie = i;
return ret
});
content = L.geoJson(getsections, {style: style, onEachFeature: onEachF, pane: pane});
return getsections.features;
}
data_nrt_sst = $.getJSON("data/nrt_sst.json", function(data){
}).fail(function(){
console.log("An error has occurred.");
});
data_nrt_lai = $.getJSON("data/nrt_lai.json", function(data){
}).fail(function(){
console.log("An error has occurred.");
});
data_nrt_fsce = $.getJSON("data/nrt_fsce.json", function(data){
}).fail(function(){
console.log("An error has occurred.");
});
console.log(data_nrt_fsce);
data_forecast_uv = $.getJSON("data/forecast_uv.json", function(data){
}).fail(function(){
console.log("An error has occurred.");
});
data_forecast_ragweed_pollen = $.getJSON("data/forecast_ragweed_pollen.json", function(data){
}).fail(function(){
console.log("An error has occurred.");
});
data_forecast_grass_pollen = $.getJSON("data/forecast_grass_pollen.json", function(data){
}).fail(function(){
console.log("An error has occurred.");
});
data_forecast_birch_pollen = $.getJSON("data/forecast_birch_pollen.json", function(data){
}).fail(function(){
console.log("An error has occurred.");
});
data_forecast_pm10 = $.getJSON("data/forecast_pm10.json", function(data){
}).fail(function(){
console.log("An error has occurred.");
});
data_climatic = $.getJSON("data/locations_climatic_data.json", function(data){
}).fail(function(){
console.log("An error has occurred.");
});
console.log(data_climatic);
function handler(){
if(req.readyState === XMLHttpRequest.DONE){
function hideShowLayers (layer) {
var layers = ['locations_data'];
var layersLength = layers.length;
for (var i = 0; i < layersLength; i++) {
if (layers[i] == layer){
map.addLayer(eval(layers[i]));
}
else{
map.removeLayer(eval(layers[i]));
}
}
}
var layer = 'terrain';
var map = new L.Map('mapcon',
{
center: new L.LatLng(46, 26),
zoom: 7
});
map.options.minZoom = 7;
map.createPane('locations_data');
var lightOSM = L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png', {
maxZoom: 18,
zIndex: 1,
attribution: '© Powered by Copernicus'
});
var normalOSM = L.tileLayer( 'https://api.maptiler.com/maps/topo/{z}/{x}/{y}.png?key=X8ytgIaSzVnjEGBDIuss', {
attribution: '© Powered by Copernicus',
subdomains: ['a','b','c'],
opacity: 0.5
});
var satellite = L.tileLayer( 'https://api.maptiler.com/maps/hybrid/{z}/{x}/{y}.jpg?key=X8ytgIaSzVnjEGBDIuss', {
attribution: '© Powered by Copernicus',
subdomains: ['a','b','c']
});
var OpenTopoMap = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
maxZoom: 17,
attribution: 'Map data: © OpenStreetMap contributors, SRTM | Map style: © OpenTopoMap (CC-BY-SA)'
});
var satMutant = L.gridLayer.googleMutant({
maxZoom: 24,
type:'satellite'
});
var relMutant = L.gridLayer.googleMutant({
maxZoom: 24,
type:'satellite'
});
var Esri_WorldImagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
});
var Esri_WorldTopoMap = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community'
});
var blankBasemap = L.tileLayer('');
map.addLayer(lightOSM, Esri_WorldTopoMap, Esri_WorldImagery);
//Încărcare straturi din TopoJSON
locations_data = parseTopoJSON('locations_data', styleSectii, onEachFeature, 'locations_data');
locations_data2 = parseTopoJSON2('locations_data', styleSectii, onEachFeature, 'locations_data');
console.log(locations_data2.properties);
loc_search = $.getJSON('data/loc_search_point.geojson', function (data) {
fuse = new Fuse(loc_search.responseJSON.features, {
keys: [
'properties.NAME'
]
});
});
map.getPane('locations_data').style.zIndex = 1200;
map.addLayer(locations_data);
var searchControl = new L.Control.Search({
layer: locations_data,
propertyName: 'NAME',
marker: false,
filterData: function(text, records) {
var jsons = fuse.search(text),
ret = {}, key;
for(var i in jsons) {
key = jsons[i].properties.NAME;
ret[ key ]= records[key];
}
return ret;
},
moveToLocation: function(latlng, title, map) {
var zoom = map.getBoundsZoom(latlng.layer.getBounds());
map.setView(latlng, zoom);
}
});
searchControl.on('search:locationfound', function(e) {
e.layer.setStyle({fillColor: '#3f0', color: '#0f0'});
if(e.layer._popup)
e.layer.openPopup();
}).on('search:collapsed', function(e) {
featuresLayer.eachLayer(function(layer) {
featuresLayer.resetStyle(layer);
});
});
map.addControl(searchControl);
var credctrl = L.controlCredits({
image: "images/logo_copernicus.png",
link: "https://www.copernicus.eu/en",
text: "Powered by",
width: 100,
height: 45
}).addTo(map);
function highlightFeature(e){
var layer = e.target;
if (e.target.options.pane == 'locations_data')
layer.setStyle({
fillOpacity: .7
})
else{
layer.setStyle({
weight: 2,
color: '#ffffff',
dashArray: '',
fillOpacity: .7
})
}
if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {
layer.bringToFront();
}
info.update(layer.feature.properties, e.target.options.pane);
}
function resetHighlight(e){
if (e.target.options.pane == 'locations_data')
locations_data.resetStyle(e.target);
//info.update(e.target.properties, e.target.options.pane);
//$('#myChart').css('display', 'none');
//$('#rezultate_info').css('display', 'none');
}
function zoomToFeature(e) {
map.fitBounds(e.target.getBounds());
}
function onEachFeature(feature, layer){
layer.on({
mouseover: highlightFeature,
mouseout: resetHighlight, click: highlightFeature})
}
var info = L.control();
info.onAdd = function(map) {
this._div = L.DomUtil.create('div', 'info');
this.update();
return this._div;
}
info.update = function(props, strat){
if (props){
if (props.ID == 98) {
desc = "Rasnov is a small town in Brasov county but with great charm given by Rasnov Citadel and the new thematic park – Dino Parc. It is a town hosting many cultural events such as the Film Festival or the Medieval Festival. Wikipedia link.
";
}
else {
desc ="";
}
if ($('#rezultat').val() == '1'){
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Good and very good',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [props.HCI_G_JAN, props.HCI_G_FEB, props.HCI_G_MAR, props.HCI_G_APR, props.HCI_G_MAY, props.HCI_G_JUN, props.HCI_G_JUL, props.HCI_G_AUG, props.HCI_G_SEP, props.HCI_G_OCT, props.HCI_G_NOV, props.HCI_G_DEC]
},
{
label: 'Acceptable/Fair',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [props.HCI_F_JAN, props.HCI_F_FEB, props.HCI_F_MAR, props.HCI_F_APR, props.HCI_F_MAY, props.HCI_F_JUN, props.HCI_F_JUL, props.HCI_F_AUG, props.HCI_F_SEP, props.HCI_F_OCT, props.HCI_F_NOV, props.HCI_F_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return Math.round(tooltipItem.yLabel) + ' days';
}
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
this._div.innerHTML = "
" +
"
Weather for staying outdoor/for walking
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: no. of days/month ' : "") +
" " +
desc +
"";
graficRezultate(chartData, chartOptions);
}
if ($('#rezultat').val() == '2'){
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Acceptable',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [props.UCTI_A_JAN, props.UCTI_A_FEB, props.UCTI_A_MAR, props.UCTI_A_APR, props.UCTI_A_MAY, props.UCTI_A_JUN, props.UCTI_A_JUL, props.UCTI_A_AUG, props.UCTI_A_SEP, props.UCTI_A_OCT, props.UCTI_A_NOV, props.UCTI_A_DEC]
},
{
label: 'Pronounced/Strong',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [props.UCTI_S_JAN, props.UCTI_S_FEB, props.UCTI_S_MAR, props.UCTI_S_APR, props.UCTI_S_MAY, props.UCTI_S_JUN, props.UCTI_S_JUL, props.UCTI_S_AUG, props.UCTI_S_SEP, props.UCTI_S_OCT, props.UCTI_S_NOV, props.UCTI_S_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return Math.round(tooltipItem.yLabel) + ' days';
}
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
this._div.innerHTML = "" +
"
Thermal stress
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: no. of days/month ' : "") +
"" +
desc +
"";
graficRezultate(chartData, chartOptions);
}
if ($('#rezultat').val() == '3'){
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Hydrating',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [props.PS_HY_JAN, props.PS_HY_FEB, props.PS_HY_MAR, props.PS_HY_APR, props.PS_HY_MAY, props.PS_HY_JUN, props.PS_HY_JUL, props.PS_HY_AUG, props.PS_HY_SEP, props.PS_HY_OCT, props.PS_HY_NOV, props.PS_HY_DEC]
},
{
label: 'Normal',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [props.PS_N_JAN, props.PS_N_FEB, props.PS_N_MAR, props.PS_N_APR, props.PS_N_MAY, props.PS_N_JUN, props.PS_N_JUL, props.PS_N_AUG, props.PS_N_SEP, props.PS_N_OCT, props.PS_N_NOV, props.PS_N_DEC]
},
{
label: 'Dehydrating',
backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
borderColor: window.chartColors.red,
borderWidth: 1,
data: [props.PS_DE_JAN, props.PS_DE_FEB, props.PS_DE_MAR, props.PS_DE_APR, props.PS_DE_MAY, props.PS_DE_JUN, props.PS_DE_JUL, props.PS_DE_AUG, props.PS_DE_SEP, props.PS_DE_OCT, props.PS_DE_NOV, props.PS_DE_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return Math.round(tooltipItem.yLabel) + ' days';
}
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
this._div.innerHTML = "" +
"
Respiratory comfort
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: no. of days/month ' : "") +
"" +
desc +
"";
graficRezultate(chartData, chartOptions);
}
if ($('#rezultat').val() == '4'){
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Low risk',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [props.WCT_LR_JAN, props.WCT_LR_FEB, props.WCT_LR_MAR, props.WCT_LR_APR, props.WCT_LR_MAY, props.WCT_LR_JUN, props.WCT_LR_JUL, props.WCT_LR_AUG, props.WCT_LR_SEP, props.WCT_LR_OCT, props.WCT_LR_NOV, props.WCT_LR_DEC]
},
{
label: 'Medium risk',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [props.WCT_MR_JAN, props.WCT_MR_FEB, props.WCT_MR_MAR, props.WCT_MR_APR, props.WCT_MR_MAY, props.WCT_MR_JUN, props.WCT_MR_JUL, props.WCT_MR_AUG, props.WCT_MR_SEP, props.WCT_MR_OCT, props.WCT_MR_NOV, props.WCT_MR_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return Math.round(tooltipItem.yLabel) + ' days';
}
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
this._div.innerHTML = "" +
"
Frostbite risk
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: no. of days/month ' : "") +
"" +
desc +
"";
graficRezultate(chartData, chartOptions);
}
if ($('#rezultat').val() == '5'){
var color = Chart.helpers.color;
var chartData = {
labels: ['Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr'],
datasets: [{
label: '100% cover',
backgroundColor: color(window.chartColors.purple).alpha(0.5).rgbString(),
borderColor: window.chartColors.purple,
borderWidth: 1,
data: [props.SCOV_1_JAN, props.SCOV_1_FEB, props.SCOV_1_MAR, props.SCOV_1_APR, props.SCOV_1_OCT, props.SCOV_1_NOV, props.SCOV_1_DEC]
},
{
label: '50% cover',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [props.SCOV_5_JAN, props.SCOV_5_FEB, props.SCOV_5_MAR, props.SCOV_5_APR, props.SCOV_5_OCT, props.SCOV_5_NOV, props.SCOV_5_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return Math.round(tooltipItem.yLabel) + ' days';
}
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
this._div.innerHTML = "" +
"
Snow cover
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: no. of days/month ' : "") +
"" +
desc +
"";
graficRezultate(chartData, chartOptions);
}
if ($('#rezultat').val() == '6'){
var color = Chart.helpers.color;
var chartData = {
labels: ['Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr'],
datasets: [{
label: 'Optimum for ski',
backgroundColor: color(window.chartColors.purple).alpha(0.5).rgbString(),
borderColor: window.chartColors.purple,
borderWidth: 1,
data: [props.SDT_30_JAN, props.SDT_30_FEB, props.SDT_30_MAR, props.SDT_30_APR, props.SDT_30_OCT, props.SDT_30_NOV, props.SDT_30_DEC]
},
{
label: 'At least 5 cm',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [props.SDT_05_JAN, props.SDT_05_FEB, props.SDT_05_MAR, props.SDT_05_APR, props.SDT_05_OCT, props.SDT_05_NOV, props.SDT_05_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return Math.round(tooltipItem.yLabel) + ' days';
}
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
this._div.innerHTML = "" +
"
Snow depth
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: no. of days/month ' : "") +
"" +
desc +
"";
graficRezultate(chartData, chartOptions);
}
if ($('#rezultat').val() == '7'){
var color = Chart.helpers.color;
var chartData = {
labels: ['May', 'Jun', 'Jul', 'Aug', 'Sep'],
datasets: [{
label: '1st decade',
backgroundColor: color(window.chartColors.yellow).alpha(0.5).rgbString(),
borderColor: window.chartColors.yellow,
borderWidth: 1,
data: [props.SST_M_MAY1, props.SST_M_JUN1, props.SST_M_JUL1, props.SST_M_AUG1, props.SST_M_SEP1]
},{
label: '2nd decade',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [props.SST_M_MAY2, props.SST_M_JUN2, props.SST_M_JUL2, props.SST_M_AUG2, props.SST_M_SEP2]
},{
label: '3rd decade',
backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
borderColor: window.chartColors.red,
borderWidth: 1,
data: [props.SST_M_MAY3, props.SST_M_JUN3, props.SST_M_JUL3, props.SST_M_AUG3, props.SST_M_SEP3]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
this._div.innerHTML = "" +
"
Sea water temperature
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: Celsius degrees (°) ' : "") +
"" +
desc +
"";
graficRezultate(chartData, chartOptions);
}
if ($('#rezultat').val() == '8'){
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'No Green',
backgroundColor: color(window.chartColors.grey).alpha(0.5).rgbString(),
borderColor: window.chartColors.grey,
borderWidth: 1,
data: [props.GREEN1_JAN, props.GREEN1_FEB, props.GREEN1_MAR, props.GREEN1_APR, props.GREEN1_MAY, props.GREEN1_JUN, props.GREEN1_JUL, props.GREEN1_AUG, props.GREEN1_SEP, props.GREEN1_OCT, props.GREEN1_NOV, props.GREEN1_DEC]
},{
label: 'Greenish',
backgroundColor: color(window.chartColors.greenesh).alpha(0.5).rgbString(),
borderColor: window.chartColors.greenesh,
borderWidth: 1,
data: [props.GREEN2_JAN, props.GREEN2_FEB, props.GREEN2_MAR, props.GREEN2_APR, props.GREEN2_MAY, props.GREEN2_JUN, props.GREEN2_JUL, props.GREEN2_AUG, props.GREEN2_SEP, props.GREEN2_OCT, props.GREEN2_NOV, props.GREEN2_DEC]
},{
label: 'Green',
backgroundColor: color(window.chartColors.green).alpha(0.5).rgbString(),
borderColor: window.chartColors.green,
borderWidth: 1,
data: [props.GREEN3_JAN, props.GREEN3_FEB, props.GREEN3_MAR, props.GREEN3_APR, props.GREEN3_MAY, props.GREEN3_JUN, props.GREEN3_JUL, props.GREEN3_AUG, props.GREEN3_SEP, props.GREEN3_OCT, props.GREEN3_NOV, props.GREEN3_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
this._div.innerHTML = "" +
"
Green cover
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: Green area percent' : "") +
"" +
desc +
"";
graficRezultate(chartData, chartOptions);
}
//NRT SST
if ($('#rezultat').val() == '11' && (props.ID == 65 || props.ID == 64 || props.ID == 56 || props.ID == 60 || props.ID == 58 || props.ID == 52 || props.ID == 54 || props.ID == 66 || props.ID == 55 || props.ID == 53 || props.ID == 62 || props.ID == 61 || props.ID == 57 || props.ID == 51 || props.ID == 67 || props.ID == 63 || props.ID == 59)){
this._div.innerHTML = "" +
"
See water temperature
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
"" +
desc +
"";
labels_nrt_sst = data_nrt_sst.responseJSON['loc_' + props.ID].map(function(e) {
return e.date;
});
values_nrt_sst = data_nrt_sst.responseJSON['loc_' + props.ID].map(function(e) {
return e.value;
});
graficRezultateS(labels_nrt_sst, values_nrt_sst);
}
//NRT LAI
if ($('#rezultat').val() == '10'){
var color = Chart.helpers.color;
labels_nrt_lai = data_nrt_lai.responseJSON['loc_' + props.ID].map(function(e) {
return e.date;
});
d1_nrt_lai = data_nrt_lai.responseJSON['loc_' + props.ID].map(function(e) {
return e.g1p;
});
d2_nrt_lai = data_nrt_lai.responseJSON['loc_' + props.ID].map(function(e) {
return e.g2p;
});
d3_nrt_lai = data_nrt_lai.responseJSON['loc_' + props.ID].map(function(e) {
return e.g3p;
});
var chartData = {
labels: ['Mar 1', 'Mar 2', 'Mar 3', 'Apr 1', 'Apr 2', 'Apr 3', 'May 1', 'May 2', 'May 3'],
datasets: [{
label: 'No Green',
backgroundColor: color(window.chartColors.grey).alpha(0.5).rgbString(),
borderColor: window.chartColors.grey,
borderWidth: 1,
data: d1_nrt_lai
},{
label: 'Greenish',
backgroundColor: color(window.chartColors.greenesh).alpha(0.5).rgbString(),
borderColor: window.chartColors.greenesh,
borderWidth: 1,
data: d2_nrt_lai
},{
label: 'Green',
backgroundColor: color(window.chartColors.green).alpha(0.5).rgbString(),
borderColor: window.chartColors.green,
borderWidth: 1,
data: d3_nrt_lai
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
yAxes: [{
ticks: {
suggestedMin: 0,
suggestedMax: 100,
stepSize: 10
}
}],
xAxes: [{
ticks: {
autoSkip: false,
min: '20200510'
}
}],
yAxes: [{
ticks: {
//min: 'Ianuarie'
}
}]
}
}
this._div.innerHTML = "" +
"
Green cover
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: Green area percent' : "") +
"" +
desc +
"";
graficRezultate(chartData, chartOptions);
}
//NRT FSCE
if ($('#rezultat').val() == '9'){
var color = Chart.helpers.color;
labels_nrt_fsce = data_nrt_fsce.responseJSON['loc_' + props.ID].map(function(e) {
return e.date;
});
d1_nrt_fsce = data_nrt_fsce.responseJSON['loc_' + props.ID].map(function(e) {
return e.g1p;
});
var chartData = {
labels: ['Dec 1', 'Dec 2'],
datasets: [{
label: 'Snow cover',
backgroundColor: color(window.chartColors.grey).alpha(0.5).rgbString(),
borderColor: window.chartColors.grey,
borderWidth: 1,
data: d1_nrt_fsce
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false,
min: '20201210'
}
}],
yAxes: [{
ticks: {
suggestedMin: 0,
suggestedMax: 100,
stepSize: 10
}
}]
}
}
this._div.innerHTML = "" +
"
Snow cover
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: Snow covered area percent' : "") +
"" +
desc +
"";
graficRezultate(chartData, chartOptions);
}
//Forecast UV
if ($('#rezultat').val() == '12'){
values_forecast_uv = data_forecast_uv.responseJSON['loc_' + props.ID].map(function(e) {
return e.value;
});
if (Number(values_forecast_uv) <= 2) {
divColor = '#359454';
} else
if (Number(values_forecast_uv) > 2 && Number(values_forecast_uv) <= 5) {
divColor = '#f2cd1c';
} else
if (Number(values_forecast_uv) > 5 && Number(values_forecast_uv) <= 7) {
divColor = '#d8572f';
} else
if (Number(values_forecast_uv) >= 8 && Number(values_forecast_uv) < 10) {
divColor = '#bf245e';
} else
if (Number(values_forecast_uv) >= 11) {
divColor = '#9b59b6';
}
this._div.innerHTML = "" +
"
Sunburn risk
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
"
" + Number(values_forecast_uv).toFixed(2) + " |
" +
"
Low (1, 2) | Moderate (3, 4, 5) | High (6, 7) | Very high (8, 9, 10) | Extreme (11+) |
" +
desc +
"
";
}
//Forecast Polen
if ($('#rezultat').val() == '13'){
values_forecast_ragweed_pollen = data_forecast_ragweed_pollen.responseJSON['loc_ragweed_pollen_' + props.ID].map(function(e) {
return e.value;
});
values_forecast_grass_pollen = data_forecast_grass_pollen.responseJSON['loc_grass_pollen_' + props.ID].map(function(e) {
return e.value;
});
values_forecast_birch_pollen = data_forecast_birch_pollen.responseJSON['loc_birch_pollen_' + props.ID].map(function(e) {
return e.value;
});
switch (true) {
case (values_forecast_ragweed_pollen <= 1):
divColor = '#DCDCDC';
break;
case (values_forecast_ragweed_pollen <= 5):
divColor = '#1563d1';
break;
case (values_forecast_ragweed_pollen <= 10):
divColor = '#2881ef';
break;
case (values_forecast_ragweed_pollen <= 50):
divColor = '#50a4f4';
break;
case (values_forecast_ragweed_pollen <= 100):
divColor = '#04dd00';
break;
case (values_forecast_ragweed_pollen <= 500):
divColor = '#4ef150';
break;
case (values_forecast_ragweed_pollen <= 1000):
divColor = '#a0e530';
break;
case (values_forecast_ragweed_pollen <= 2000):
divColor = '#e5dc30';
break;
case (values_forecast_ragweed_pollen <= 5000):
divColor = '#e6af2d';
break;
case (values_forecast_ragweed_pollen <= 10000):
divColor = '#f08127';
break;
case (values_forecast_ragweed_pollen <= 20000):
divColor = '#fa3d3c';
break;
case (values_forecast_ragweed_pollen > 20000):
divColor = '#f00081';
break;
}
switch (true) {
case (values_forecast_grass_pollen <= 1):
divColorGrass = '#DCDCDC';
break;
case (values_forecast_grass_pollen <= 5):
divColorGrass = '#1563d1';
break;
case (values_forecast_grass_pollen <= 10):
divColorGrass = '#2881ef';
break;
case (values_forecast_grass_pollen <= 50):
divColorGrass = '#50a4f4';
break;
case (values_forecast_grass_pollen <= 100):
divColorGrass = '#04dd00';
break;
case (values_forecast_grass_pollen <= 500):
divColorGrass = '#4ef150';
break;
case (values_forecast_grass_pollen <= 1000):
divColorGrass = '#a0e530';
break;
case (values_forecast_grass_pollen <= 2000):
divColorGrass = '#e5dc30';
break;
case (values_forecast_grass_pollen <= 5000):
divColorGrass = '#e6af2d';
break;
case (values_forecast_grass_pollen <= 10000):
divColorGrass = '#f08127';
break;
case (values_forecast_grass_pollen <= 20000):
divColorGrass = '#fa3d3c';
break;
case (values_forecast_grass_pollen > 20000):
divColorGrass = '#f00081';
break;
}
switch (true) {
case (values_forecast_birch_pollen <= 1):
divColorBirch = '#DCDCDC';
break;
case (values_forecast_birch_pollen <= 5):
divColorBirch = '#1563d1';
break;
case (values_forecast_birch_pollen <= 10):
divColorBirch = '#2881ef';
break;
case (values_forecast_birch_pollen <= 50):
divColorBirch = '#50a4f4';
break;
case (values_forecast_birch_pollen <= 100):
divColorBirch = '#04dd00';
break;
case (values_forecast_birch_pollen <= 500):
divColorBirch = '#4ef150';
break;
case (values_forecast_birch_pollen <= 1000):
divColorBirch = '#a0e530';
break;
case (values_forecast_birch_pollen <= 2000):
divColorBirch = '#e5dc30';
break;
case (values_forecast_birch_pollen <= 5000):
divColorBirch = '#e6af2d';
break;
case (values_forecast_birch_pollen <= 10000):
divColorBirch = '#f08127';
break;
case (values_forecast_birch_pollen <= 20000):
divColorBirch = '#fa3d3c';
break;
case (values_forecast_birch_pollen > 20000):
divColorBirch = '#f00081';
break;
}
this._div.innerHTML = "" +
"
Pollen allergy risk
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
(props ? 'Measurement units: grains/m3 ' : "") +
(props ? '
Ragweed - daily max concentration: ' : "") +
"
" + Number(values_forecast_ragweed_pollen).toFixed(2) + " |
" +
(props ? '
Grass - daily max concentration: ' : "") +
"
" + Number(values_forecast_grass_pollen).toFixed(2) + " |
" +
(props ? '
Birch - daily max concentration: ' : "") +
"
" + Number(values_forecast_birch_pollen).toFixed(2) + " |
" +
"
<1 | <5 | <10 | <50 | <100 | <500 | <1000 | <2000 | <5000 | <10000 | <20000 | >20000 |
" +
desc +
"
";
}
//Forecast pM10
if ($('#rezultat').val() == '14'){
values_forecast_pm10 = data_forecast_pm10.responseJSON['loc_pm10_' + props.ID].map(function(e) {
return e.value;
});
switch (true) {
case (values_forecast_pm10 <= 2):
divColor = '#DCDCDC';
break;
case (values_forecast_pm10 <= 5):
divColor = '#1563d1';
break;
case (values_forecast_pm10 <= 10):
divColor = '#2881ef';
break;
case (values_forecast_pm10 <= 20):
divColor = '#50a4f4';
break;
case (values_forecast_pm10 <= 30):
divColor = '#04dd00';
break;
case (values_forecast_pm10 <= 40):
divColor = '#4ef150';
break;
case (values_forecast_pm10 <= 50):
divColor = '#a0e530';
break;
case (values_forecast_pm10 <= 75):
divColor = '#e5dc30';
break;
case (values_forecast_pm10 <= 100):
divColor = '#e6af2d';
break;
case (values_forecast_pm10 <= 150):
divColor = '#f08127';
break;
case (values_forecast_pm10 <= 200):
divColor = '#fa3d3c';
break;
case (values_forecast_pm10 > 200):
divColor = '#f00081';
break;
}
this._div.innerHTML = "" +
"
Urban/Traffic Pollution alert (PM10)
" +
(props ? 'Touristic location: ' + titleCase(props.NAME) + '' : "") +
(props ? 'Location type: ' + titleCase(props.TYPE_EN) + '' : "") +
"
" + Number(values_forecast_pm10).toFixed(2) + " µg/m3 |
" +
"
<2 | <5 | <10 | <20 | <30 | <40 | <50 | <75 | <100 | <150 | <200 | >200 |
" +
desc +
"
";
}
}
}
info.addTo(map);
$('.leaflet-control-attribution').hide();
//Compare
$(".selectare-comparatie").change(function(){
if ($('#selectare-tip-parametru').val() == '14'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
values_forecast_pm10 = data_forecast_pm10.responseJSON['loc_pm10_' + compare_location1].map(function(e) {
return e.value;
});
switch (true) {
case (values_forecast_pm10 <= 2):
divColor = '#DCDCDC';
break;
case (values_forecast_pm10 <= 5):
divColor = '#1563d1';
break;
case (values_forecast_pm10 <= 10):
divColor = '#2881ef';
break;
case (values_forecast_pm10 <= 20):
divColor = '#50a4f4';
break;
case (values_forecast_pm10 <= 30):
divColor = '#04dd00';
break;
case (values_forecast_pm10 <= 40):
divColor = '#4ef150';
break;
case (values_forecast_pm10 <= 50):
divColor = '#a0e530';
break;
case (values_forecast_pm10 <= 75):
divColor = '#e5dc30';
break;
case (values_forecast_pm10 <= 100):
divColor = '#e6af2d';
break;
case (values_forecast_pm10 <= 150):
divColor = '#f08127';
break;
case (values_forecast_pm10 <= 200):
divColor = '#fa3d3c';
break;
case (values_forecast_pm10 > 200):
divColor = '#f00081';
break;
}
document.getElementById("info-compare-1").innerHTML = "" +
"
" + Number(values_forecast_pm10).toFixed(2) + " µg/m3 |
" +
"
<2 | <5 | <10 | <20 | <30 | <40 | <50 | <75 | <100 | <150 | <200 | >200 |
" +
desc +
"
";
//coloana 2
compare_location2 = $('#select-locatia-2').val()
values_forecast_pm10 = data_forecast_pm10.responseJSON['loc_pm10_' + compare_location2].map(function(e) {
return e.value;
});
switch (true) {
case (values_forecast_pm10 <= 2):
divColor = '#DCDCDC';
break;
case (values_forecast_pm10 <= 5):
divColor = '#1563d1';
break;
case (values_forecast_pm10 <= 10):
divColor = '#2881ef';
break;
case (values_forecast_pm10 <= 20):
divColor = '#50a4f4';
break;
case (values_forecast_pm10 <= 30):
divColor = '#04dd00';
break;
case (values_forecast_pm10 <= 40):
divColor = '#4ef150';
break;
case (values_forecast_pm10 <= 50):
divColor = '#a0e530';
break;
case (values_forecast_pm10 <= 75):
divColor = '#e5dc30';
break;
case (values_forecast_pm10 <= 100):
divColor = '#e6af2d';
break;
case (values_forecast_pm10 <= 150):
divColor = '#f08127';
break;
case (values_forecast_pm10 <= 200):
divColor = '#fa3d3c';
break;
case (values_forecast_pm10 > 200):
divColor = '#f00081';
break;
}
document.getElementById("info-compare-2").innerHTML = "" +
"
" + Number(values_forecast_pm10).toFixed(2) + " µg/m3 |
" +
"
<2 | <5 | <10 | <20 | <30 | <40 | <50 | <75 | <100 | <150 | <200 | >200 |
" +
desc +
"
";
}
if ($('#selectare-tip-parametru').val() == '12'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
values_forecast_uv = data_forecast_uv.responseJSON['loc_' + compare_location1].map(function(e) {
return e.value;
});
if (Number(values_forecast_uv) <= 2) {
divColor = '#359454';
} else
if (Number(values_forecast_uv) > 2 && Number(values_forecast_uv) <= 5) {
divColor = '#f2cd1c';
} else
if (Number(values_forecast_uv) > 5 && Number(values_forecast_uv) <= 7) {
divColor = '#d8572f';
} else
if (Number(values_forecast_uv) >= 8 && Number(values_forecast_uv) < 10) {
divColor = '#bf245e';
} else
if (Number(values_forecast_uv) >= 11) {
divColor = '#9b59b6';
}
document.getElementById("info-compare-1").innerHTML = "" +
"
" + Number(values_forecast_uv).toFixed(2) + " |
" +
"
Low (1, 2) | Moderate (3, 4, 5) | High (6, 7) | Very high (8, 9, 10) | Extreme (11+) |
" +
desc +
"
";
//coloana 2
compare_location2 = $('#select-locatia-2').val()
values_forecast_uv = data_forecast_uv.responseJSON['loc_' + compare_location2].map(function(e) {
return e.value;
});
if (Number(values_forecast_uv) <= 2) {
divColor = '#359454';
} else
if (Number(values_forecast_uv) > 2 && Number(values_forecast_uv) <= 5) {
divColor = '#f2cd1c';
} else
if (Number(values_forecast_uv) > 5 && Number(values_forecast_uv) <= 7) {
divColor = '#d8572f';
} else
if (Number(values_forecast_uv) >= 8 && Number(values_forecast_uv) < 10) {
divColor = '#bf245e';
} else
if (Number(values_forecast_uv) >= 11) {
divColor = '#9b59b6';
}
document.getElementById("info-compare-2").innerHTML = "" +
"
" + Number(values_forecast_uv).toFixed(2) + " |
" +
"
Low (1, 2) | Moderate (3, 4, 5) | High (6, 7) | Very high (8, 9, 10) | Extreme (11+) |
" +
desc +
"
";
}
if ($('#selectare-tip-parametru').val() == '13'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
values_forecast_ragweed_pollen = data_forecast_ragweed_pollen.responseJSON['loc_ragweed_pollen_' + compare_location1].map(function(e) {
return e.value;
});
values_forecast_grass_pollen = data_forecast_grass_pollen.responseJSON['loc_grass_pollen_' + compare_location1].map(function(e) {
return e.value;
});
values_forecast_birch_pollen = data_forecast_birch_pollen.responseJSON['loc_birch_pollen_' + compare_location1].map(function(e) {
return e.value;
});
switch (true) {
case (values_forecast_ragweed_pollen <= 1):
divColor = '#DCDCDC';
break;
case (values_forecast_ragweed_pollen <= 5):
divColor = '#1563d1';
break;
case (values_forecast_ragweed_pollen <= 10):
divColor = '#2881ef';
break;
case (values_forecast_ragweed_pollen <= 50):
divColor = '#50a4f4';
break;
case (values_forecast_ragweed_pollen <= 100):
divColor = '#04dd00';
break;
case (values_forecast_ragweed_pollen <= 500):
divColor = '#4ef150';
break;
case (values_forecast_ragweed_pollen <= 1000):
divColor = '#a0e530';
break;
case (values_forecast_ragweed_pollen <= 2000):
divColor = '#e5dc30';
break;
case (values_forecast_ragweed_pollen <= 5000):
divColor = '#e6af2d';
break;
case (values_forecast_ragweed_pollen <= 10000):
divColor = '#f08127';
break;
case (values_forecast_ragweed_pollen <= 20000):
divColor = '#fa3d3c';
break;
case (values_forecast_ragweed_pollen > 20000):
divColor = '#f00081';
break;
}
switch (true) {
case (values_forecast_grass_pollen <= 1):
divColorGrass = '#DCDCDC';
break;
case (values_forecast_grass_pollen <= 5):
divColorGrass = '#1563d1';
break;
case (values_forecast_grass_pollen <= 10):
divColorGrass = '#2881ef';
break;
case (values_forecast_grass_pollen <= 50):
divColorGrass = '#50a4f4';
break;
case (values_forecast_grass_pollen <= 100):
divColorGrass = '#04dd00';
break;
case (values_forecast_grass_pollen <= 500):
divColorGrass = '#4ef150';
break;
case (values_forecast_grass_pollen <= 1000):
divColorGrass = '#a0e530';
break;
case (values_forecast_grass_pollen <= 2000):
divColorGrass = '#e5dc30';
break;
case (values_forecast_grass_pollen <= 5000):
divColorGrass = '#e6af2d';
break;
case (values_forecast_grass_pollen <= 10000):
divColorGrass = '#f08127';
break;
case (values_forecast_grass_pollen <= 20000):
divColorGrass = '#fa3d3c';
break;
case (values_forecast_grass_pollen > 20000):
divColorGrass = '#f00081';
break;
}
switch (true) {
case (values_forecast_birch_pollen <= 1):
divColorBirch = '#DCDCDC';
break;
case (values_forecast_birch_pollen <= 5):
divColorBirch = '#1563d1';
break;
case (values_forecast_birch_pollen <= 10):
divColorBirch = '#2881ef';
break;
case (values_forecast_birch_pollen <= 50):
divColorBirch = '#50a4f4';
break;
case (values_forecast_birch_pollen <= 100):
divColorBirch = '#04dd00';
break;
case (values_forecast_birch_pollen <= 500):
divColorBirch = '#4ef150';
break;
case (values_forecast_birch_pollen <= 1000):
divColorBirch = '#a0e530';
break;
case (values_forecast_birch_pollen <= 2000):
divColorBirch = '#e5dc30';
break;
case (values_forecast_birch_pollen <= 5000):
divColorBirch = '#e6af2d';
break;
case (values_forecast_birch_pollen <= 10000):
divColorBirch = '#f08127';
break;
case (values_forecast_birch_pollen <= 20000):
divColorBirch = '#fa3d3c';
break;
case (values_forecast_birch_pollen > 20000):
divColorBirch = '#f00081';
break;
}
document.getElementById("info-compare-1").innerHTML = "" +
'
Ragweed - daily max concentration: ' +
"
" + Number(values_forecast_ragweed_pollen).toFixed(2) + " |
" +
'
Grass - daily max concentration: ' +
"
" + Number(values_forecast_grass_pollen).toFixed(2) + " |
" +
'
Birch - daily max concentration: ' +
"
" + Number(values_forecast_birch_pollen).toFixed(2) + " |
" +
"
<1 | <5 | <10 | <50 | <100 | <500 | <1000 | <2000 | <5000 | <10000 | <20000 | >20000 |
" +
desc +
"
";
//coloana 2
compare_location2 = $('#select-locatia-2').val()
values_forecast_ragweed_pollen = data_forecast_ragweed_pollen.responseJSON['loc_ragweed_pollen_' + compare_location2].map(function(e) {
return e.value;
});
values_forecast_grass_pollen = data_forecast_grass_pollen.responseJSON['loc_grass_pollen_' + compare_location2].map(function(e) {
return e.value;
});
values_forecast_birch_pollen = data_forecast_birch_pollen.responseJSON['loc_birch_pollen_' + compare_location2].map(function(e) {
return e.value;
});
switch (true) {
case (values_forecast_ragweed_pollen <= 1):
divColor = '#DCDCDC';
break;
case (values_forecast_ragweed_pollen <= 5):
divColor = '#1563d1';
break;
case (values_forecast_ragweed_pollen <= 10):
divColor = '#2881ef';
break;
case (values_forecast_ragweed_pollen <= 50):
divColor = '#50a4f4';
break;
case (values_forecast_ragweed_pollen <= 100):
divColor = '#04dd00';
break;
case (values_forecast_ragweed_pollen <= 500):
divColor = '#4ef150';
break;
case (values_forecast_ragweed_pollen <= 1000):
divColor = '#a0e530';
break;
case (values_forecast_ragweed_pollen <= 2000):
divColor = '#e5dc30';
break;
case (values_forecast_ragweed_pollen <= 5000):
divColor = '#e6af2d';
break;
case (values_forecast_ragweed_pollen <= 10000):
divColor = '#f08127';
break;
case (values_forecast_ragweed_pollen <= 20000):
divColor = '#fa3d3c';
break;
case (values_forecast_ragweed_pollen > 20000):
divColor = '#f00081';
break;
}
switch (true) {
case (values_forecast_grass_pollen <= 1):
divColorGrass = '#DCDCDC';
break;
case (values_forecast_grass_pollen <= 5):
divColorGrass = '#1563d1';
break;
case (values_forecast_grass_pollen <= 10):
divColorGrass = '#2881ef';
break;
case (values_forecast_grass_pollen <= 50):
divColorGrass = '#50a4f4';
break;
case (values_forecast_grass_pollen <= 100):
divColorGrass = '#04dd00';
break;
case (values_forecast_grass_pollen <= 500):
divColorGrass = '#4ef150';
break;
case (values_forecast_grass_pollen <= 1000):
divColorGrass = '#a0e530';
break;
case (values_forecast_grass_pollen <= 2000):
divColorGrass = '#e5dc30';
break;
case (values_forecast_grass_pollen <= 5000):
divColorGrass = '#e6af2d';
break;
case (values_forecast_grass_pollen <= 10000):
divColorGrass = '#f08127';
break;
case (values_forecast_grass_pollen <= 20000):
divColorGrass = '#fa3d3c';
break;
case (values_forecast_grass_pollen > 20000):
divColorGrass = '#f00081';
break;
}
switch (true) {
case (values_forecast_birch_pollen <= 1):
divColorBirch = '#DCDCDC';
break;
case (values_forecast_birch_pollen <= 5):
divColorBirch = '#1563d1';
break;
case (values_forecast_birch_pollen <= 10):
divColorBirch = '#2881ef';
break;
case (values_forecast_birch_pollen <= 50):
divColorBirch = '#50a4f4';
break;
case (values_forecast_birch_pollen <= 100):
divColorBirch = '#04dd00';
break;
case (values_forecast_birch_pollen <= 500):
divColorBirch = '#4ef150';
break;
case (values_forecast_birch_pollen <= 1000):
divColorBirch = '#a0e530';
break;
case (values_forecast_birch_pollen <= 2000):
divColorBirch = '#e5dc30';
break;
case (values_forecast_birch_pollen <= 5000):
divColorBirch = '#e6af2d';
break;
case (values_forecast_birch_pollen <= 10000):
divColorBirch = '#f08127';
break;
case (values_forecast_birch_pollen <= 20000):
divColorBirch = '#fa3d3c';
break;
case (values_forecast_birch_pollen > 20000):
divColorBirch = '#f00081';
break;
}
document.getElementById("info-compare-2").innerHTML = "" +
'
Ragweed - daily max concentration: ' +
"
" + Number(values_forecast_ragweed_pollen).toFixed(2) + " |
" +
'
Grass - daily max concentration: ' +
"
" + Number(values_forecast_grass_pollen).toFixed(2) + " |
" +
'
Birch - daily max concentration: ' +
"
" + Number(values_forecast_birch_pollen).toFixed(2) + " |
" +
"
<1 | <5 | <10 | <50 | <100 | <500 | <1000 | <2000 | <5000 | <10000 | <20000 | >20000 |
" +
desc +
"
";
}
if ($('#selectare-tip-parametru').val() == '9'){
//coloana 1
var color = Chart.helpers.color;
compare_location1 = $('#select-locatia-1').val()
labels_nrt_fsce = data_nrt_fsce.responseJSON['loc_' + compare_location1].map(function(e) {
return e.date;
});
d1_nrt_fsce = data_nrt_fsce.responseJSON['loc_' + compare_location1].map(function(e) {
return e.g1p;
});
var chartData = {
labels: ['Dec 1', 'Dec 2'],
datasets: [{
label: 'Snow cover',
backgroundColor: color(window.chartColors.grey).alpha(0.5).rgbString(),
borderColor: window.chartColors.grey,
borderWidth: 1,
data: d1_nrt_fsce
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false,
min: '20201210'
}
}],
yAxes: [{
ticks: {
suggestedMin: 0,
suggestedMax: 100,
stepSize: 10
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
var color = Chart.helpers.color;
compare_location2 = $('#select-locatia-2').val()
labels_nrt_fsce = data_nrt_fsce.responseJSON['loc_' + compare_location2].map(function(e) {
return e.date;
});
d1_nrt_fsce = data_nrt_fsce.responseJSON['loc_' + compare_location2].map(function(e) {
return e.g1p;
});
var chartData = {
labels: ['Dec 1', 'Dec 2'],
datasets: [{
label: 'Snow cover',
backgroundColor: color(window.chartColors.grey).alpha(0.5).rgbString(),
borderColor: window.chartColors.grey,
borderWidth: 1,
data: d1_nrt_fsce
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false,
min: '20201210'
}
}],
yAxes: [{
ticks: {
suggestedMin: 0,
suggestedMax: 100,
stepSize: 10
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '10'){
//coloana 1
var color = Chart.helpers.color;
compare_location1 = $('#select-locatia-1').val()
labels_nrt_lai = data_nrt_lai.responseJSON['loc_' + compare_location1].map(function(e) {
return e.date;
});
d1_nrt_lai = data_nrt_lai.responseJSON['loc_' + compare_location1].map(function(e) {
return e.g1p;
});
d2_nrt_lai = data_nrt_lai.responseJSON['loc_' + compare_location1].map(function(e) {
return e.g2p;
});
d3_nrt_lai = data_nrt_lai.responseJSON['loc_' + compare_location1].map(function(e) {
return e.g3p;
});
var chartData = {
labels: ['Apr 1', 'Apr 2', 'Apr 3', 'May 1', 'May 2', 'May 3', 'Jun 1', 'Jun 2', 'Jun 3', 'Jul 1', 'Jul 2', 'Jul 3', 'Aug 1', 'Aug 2', 'Aug 3', 'Sep 1', 'Sep 2', 'Sep 3', 'Oct 1', 'Oct 2', 'Oct 3'],
datasets: [{
label: 'No Green',
backgroundColor: color(window.chartColors.grey).alpha(0.5).rgbString(),
borderColor: window.chartColors.grey,
borderWidth: 1,
data: d1_nrt_lai
},{
label: 'Greenish',
backgroundColor: color(window.chartColors.greenesh).alpha(0.5).rgbString(),
borderColor: window.chartColors.greenesh,
borderWidth: 1,
data: d2_nrt_lai
},{
label: 'Green',
backgroundColor: color(window.chartColors.green).alpha(0.5).rgbString(),
borderColor: window.chartColors.green,
borderWidth: 1,
data: d3_nrt_lai
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
yAxes: [{
ticks: {
suggestedMin: 0,
suggestedMax: 100,
stepSize: 10
}
}],
xAxes: [{
ticks: {
autoSkip: false,
min: '20200510'
}
}],
yAxes: [{
ticks: {
//min: 'Ianuarie'
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
var color = Chart.helpers.color;
compare_location2 = $('#select-locatia-2').val()
labels_nrt_lai = data_nrt_lai.responseJSON['loc_' + compare_location2].map(function(e) {
return e.date;
});
d1_nrt_lai = data_nrt_lai.responseJSON['loc_' + compare_location2].map(function(e) {
return e.g1p;
});
d2_nrt_lai = data_nrt_lai.responseJSON['loc_' + compare_location2].map(function(e) {
return e.g2p;
});
d3_nrt_lai = data_nrt_lai.responseJSON['loc_' + compare_location2].map(function(e) {
return e.g3p;
});
var chartData = {
labels: ['Apr 1', 'Apr 2', 'Apr 3', 'May 1', 'May 2', 'May 3', 'Jun 1', 'Jun 2', 'Jun 3', 'Jul 1', 'Jul 2', 'Jul 3', 'Aug 1', 'Aug 2', 'Aug 3', 'Sep 1', 'Sep 2', 'Sep 3', 'Oct 1', 'Oct 2', 'Oct 3'],
datasets: [{
label: 'No Green',
backgroundColor: color(window.chartColors.grey).alpha(0.5).rgbString(),
borderColor: window.chartColors.grey,
borderWidth: 1,
data: d1_nrt_lai
},{
label: 'Greenish',
backgroundColor: color(window.chartColors.greenesh).alpha(0.5).rgbString(),
borderColor: window.chartColors.greenesh,
borderWidth: 1,
data: d2_nrt_lai
},{
label: 'Green',
backgroundColor: color(window.chartColors.green).alpha(0.5).rgbString(),
borderColor: window.chartColors.green,
borderWidth: 1,
data: d3_nrt_lai
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
yAxes: [{
ticks: {
suggestedMin: 0,
suggestedMax: 100,
stepSize: 10
}
}],
xAxes: [{
ticks: {
autoSkip: false,
min: '20200510'
}
}],
yAxes: [{
ticks: {
//min: 'Ianuarie'
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '11'){
//coloana 1
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
compare_location1 = $('#select-locatia-1').val()
console.log(compare_location1);
labels_nrt_sst = data_nrt_sst.responseJSON['loc_' + compare_location1].map(function(e) {
return e.date;
});
values_nrt_sst = data_nrt_sst.responseJSON['loc_' + compare_location1].map(function(e) {
return e.value;
});
graficRezultateS1(labels_nrt_sst, values_nrt_sst);
//graficRezultateCompare(chartData, chartOptions);
//coloana 2
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
compare_location2 = $('#select-locatia-2').val()
labels_nrt_sst = data_nrt_sst.responseJSON['loc_' + compare_location2].map(function(e) {
return e.date;
});
values_nrt_sst = data_nrt_sst.responseJSON['loc_' + compare_location2].map(function(e) {
return e.value;
});
graficRezultateS2(labels_nrt_sst, values_nrt_sst);
//graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '1'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
d_climatic_outside = data_climatic.responseJSON[compare_location1].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Good and very good',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].HCI_G_JAN, d_climatic_outside[0].HCI_G_FEB, d_climatic_outside[0].HCI_G_MAR, d_climatic_outside[0].HCI_G_APR, d_climatic_outside[0].HCI_G_MAY, d_climatic_outside[0].HCI_G_JUN, d_climatic_outside[0].HCI_G_JUL, d_climatic_outside[0].HCI_G_AUG, d_climatic_outside[0].HCI_G_SEP, d_climatic_outside[0].HCI_G_OCT, d_climatic_outside[0].HCI_G_NOV, d_climatic_outside.HCI_G_DEC]
},
{
label: 'Acceptable/Fair',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].HCI_F_JAN, d_climatic_outside[0].HCI_F_FEB, d_climatic_outside[0].HCI_F_MAR, d_climatic_outside[0].HCI_F_APR, d_climatic_outside[0].HCI_F_MAY, d_climatic_outside[0].HCI_F_JUN, d_climatic_outside[0].HCI_F_JUL, d_climatic_outside[0].HCI_F_AUG, d_climatic_outside[0].HCI_F_SEP, d_climatic_outside[0].HCI_F_OCT, d_climatic_outside[0].HCI_F_NOV, d_climatic_outside[0].HCI_F_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
compare_location2 = $('#select-locatia-2').val()
d_climatic_outside = data_climatic.responseJSON[compare_location2].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Good and very good',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].HCI_G_JAN, d_climatic_outside[0].HCI_G_FEB, d_climatic_outside[0].HCI_G_MAR, d_climatic_outside[0].HCI_G_APR, d_climatic_outside[0].HCI_G_MAY, d_climatic_outside[0].HCI_G_JUN, d_climatic_outside[0].HCI_G_JUL, d_climatic_outside[0].HCI_G_AUG, d_climatic_outside[0].HCI_G_SEP, d_climatic_outside[0].HCI_G_OCT, d_climatic_outside[0].HCI_G_NOV, d_climatic_outside.HCI_G_DEC]
},
{
label: 'Acceptable/Fair',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].HCI_F_JAN, d_climatic_outside[0].HCI_F_FEB, d_climatic_outside[0].HCI_F_MAR, d_climatic_outside[0].HCI_F_APR, d_climatic_outside[0].HCI_F_MAY, d_climatic_outside[0].HCI_F_JUN, d_climatic_outside[0].HCI_F_JUL, d_climatic_outside[0].HCI_F_AUG, d_climatic_outside[0].HCI_F_SEP, d_climatic_outside[0].HCI_F_OCT, d_climatic_outside[0].HCI_F_NOV, d_climatic_outside[0].HCI_F_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '2'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
d_climatic_outside = data_climatic.responseJSON[compare_location1].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Acceptable',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].UCTI_A_JAN, d_climatic_outside[0].UCTI_A_FEB, d_climatic_outside[0].UCTI_A_MAR, d_climatic_outside[0].UCTI_A_APR, d_climatic_outside[0].UCTI_A_MAY, d_climatic_outside[0].UCTI_A_JUN, d_climatic_outside[0].UCTI_A_JUL, d_climatic_outside[0].UCTI_A_AUG, d_climatic_outside[0].UCTI_A_SEP, d_climatic_outside[0].UCTI_A_OCT, d_climatic_outside[0].UCTI_A_NOV, d_climatic_outside[0].UCTI_A_DEC]
},
{
label: 'Pronounced/Strong',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].UCTI_S_JAN, d_climatic_outside[0].UCTI_S_FEB, d_climatic_outside[0].UCTI_S_MAR, d_climatic_outside[0].UCTI_S_APR, d_climatic_outside[0].UCTI_S_MAY, d_climatic_outside[0].UCTI_S_JUN, d_climatic_outside[0].UCTI_S_JUL, d_climatic_outside[0].UCTI_S_AUG, d_climatic_outside[0].UCTI_S_SEP, d_climatic_outside[0].UCTI_S_OCT, d_climatic_outside[0].UCTI_S_NOV, d_climatic_outside[0].UCTI_S_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
compare_location2 = $('#select-locatia-2').val()
d_climatic_outside = data_climatic.responseJSON[compare_location2].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Acceptable',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].UCTI_A_JAN, d_climatic_outside[0].UCTI_A_FEB, d_climatic_outside[0].UCTI_A_MAR, d_climatic_outside[0].UCTI_A_APR, d_climatic_outside[0].UCTI_A_MAY, d_climatic_outside[0].UCTI_A_JUN, d_climatic_outside[0].UCTI_A_JUL, d_climatic_outside[0].UCTI_A_AUG, d_climatic_outside[0].UCTI_A_SEP, d_climatic_outside[0].UCTI_A_OCT, d_climatic_outside[0].UCTI_A_NOV, d_climatic_outside[0].UCTI_A_DEC]
},
{
label: 'Pronounced/Strong',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].nuct_s_jan, d_climatic_outside[0].nuct_s_feb, d_climatic_outside[0].nuct_s_mar, d_climatic_outside[0].nuct_s_apr, d_climatic_outside[0].nuct_s_may, d_climatic_outside[0].nuct_s_jun, d_climatic_outside[0].nuct_s_jul, d_climatic_outside[0].nuct_s_aug, d_climatic_outside[0].nuct_s_sep, d_climatic_outside[0].nuct_s_oct, d_climatic_outside[0].nuct_s_nov, d_climatic_outside[0].nuct_s_dec]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '3'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
d_climatic_outside = data_climatic.responseJSON[compare_location1].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Hydrating',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].PS_HY_JAN, d_climatic_outside[0].PS_HY_FEB, d_climatic_outside[0].PS_HY_MAR, d_climatic_outside[0].PS_HY_APR, d_climatic_outside[0].PS_HY_MAY, d_climatic_outside[0].PS_HY_JUN, d_climatic_outside[0].PS_HY_JUL, d_climatic_outside[0].PS_HY_AUG, d_climatic_outside[0].PS_HY_SEP, d_climatic_outside[0].PS_HY_OCT, d_climatic_outside[0].PS_HY_NOV, d_climatic_outside[0].PS_HY_DEC]
},
{
label: 'Normal',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].PS_N_JAN, d_climatic_outside[0].PS_N_FEB, d_climatic_outside[0].PS_N_MAR, d_climatic_outside[0].PS_N_APR, d_climatic_outside[0].PS_N_MAY, d_climatic_outside[0].PS_N_JUN, d_climatic_outside[0].PS_N_JUL, d_climatic_outside[0].PS_N_AUG, d_climatic_outside[0].PS_N_SEP, d_climatic_outside[0].PS_N_OCT, d_climatic_outside[0].PS_N_NOV, d_climatic_outside[0].PS_N_DEC]
},
{
label: 'Dehydrating',
backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
borderColor: window.chartColors.red,
borderWidth: 1,
data: [d_climatic_outside[0].PS_DE_JAN, d_climatic_outside[0].PS_DE_FEB, d_climatic_outside[0].PS_DE_MAR, d_climatic_outside[0].PS_DE_APR, d_climatic_outside[0].PS_DE_MAY, d_climatic_outside[0].PS_DE_JUN, d_climatic_outside[0].PS_DE_JUL, d_climatic_outside[0].PS_DE_AUG, d_climatic_outside[0].PS_DE_SEP, d_climatic_outside[0].PS_DE_OCT, d_climatic_outside[0].PS_DE_NOV, d_climatic_outside[0].PS_DE_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
compare_location2 = $('#select-locatia-2').val()
d_climatic_outside = data_climatic.responseJSON[compare_location2].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Hydrating',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].PS_HY_JAN, d_climatic_outside[0].PS_HY_FEB, d_climatic_outside[0].PS_HY_MAR, d_climatic_outside[0].PS_HY_APR, d_climatic_outside[0].PS_HY_MAY, d_climatic_outside[0].PS_HY_JUN, d_climatic_outside[0].PS_HY_JUL, d_climatic_outside[0].PS_HY_AUG, d_climatic_outside[0].PS_HY_SEP, d_climatic_outside[0].PS_HY_OCT, d_climatic_outside[0].PS_HY_NOV, d_climatic_outside[0].PS_HY_DEC]
},
{
label: 'Normal',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].PS_N_JAN, d_climatic_outside[0].PS_N_FEB, d_climatic_outside[0].PS_N_MAR, d_climatic_outside[0].PS_N_APR, d_climatic_outside[0].PS_N_MAY, d_climatic_outside[0].PS_N_JUN, d_climatic_outside[0].PS_N_JUL, d_climatic_outside[0].PS_N_AUG, d_climatic_outside[0].PS_N_SEP, d_climatic_outside[0].PS_N_OCT, d_climatic_outside[0].PS_N_NOV, d_climatic_outside[0].PS_N_DEC]
},
{
label: 'Dehydrating',
backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
borderColor: window.chartColors.red,
borderWidth: 1,
data: [d_climatic_outside[0].PS_DE_JAN, d_climatic_outside[0].PS_DE_FEB, d_climatic_outside[0].PS_DE_MAR, d_climatic_outside[0].PS_DE_APR, d_climatic_outside[0].PS_DE_MAY, d_climatic_outside[0].PS_DE_JUN, d_climatic_outside[0].PS_DE_JUL, d_climatic_outside[0].PS_DE_AUG, d_climatic_outside[0].PS_DE_SEP, d_climatic_outside[0].PS_DE_OCT, d_climatic_outside[0].PS_DE_NOV, d_climatic_outside[0].PS_DE_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '4'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
d_climatic_outside = data_climatic.responseJSON[compare_location1].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Low risk',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].WCT_LR_JAN, d_climatic_outside[0].WCT_LR_FEB, d_climatic_outside[0].WCT_LR_MAR, d_climatic_outside[0].WCT_LR_APR, d_climatic_outside[0].WCT_LR_MAY, d_climatic_outside[0].WCT_LR_JUN, d_climatic_outside[0].WCT_LR_JUL, d_climatic_outside[0].WCT_LR_AUG, d_climatic_outside[0].WCT_LR_SEP, d_climatic_outside[0].WCT_LR_OCT, d_climatic_outside[0].WCT_LR_NOV, d_climatic_outside[0].WCT_LR_DEC]
},
{
label: 'Medium risk',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].WCT_MR_JAN, d_climatic_outside[0].WCT_MR_FEB, d_climatic_outside[0].WCT_MR_MAR, d_climatic_outside[0].WCT_MR_APR, d_climatic_outside[0].WCT_MR_MAY, d_climatic_outside[0].WCT_MR_JUN, d_climatic_outside[0].WCT_MR_JUL, d_climatic_outside[0].WCT_MR_AUG, d_climatic_outside[0].WCT_MR_SEP, d_climatic_outside[0].WCT_MR_OCT, d_climatic_outside[0].WCT_MR_NOV, d_climatic_outside[0].WCT_MR_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
compare_location2 = $('#select-locatia-2').val()
d_climatic_outside = data_climatic.responseJSON[compare_location2].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Low risk',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].WCT_LR_JAN, d_climatic_outside[0].WCT_LR_FEB, d_climatic_outside[0].WCT_LR_MAR, d_climatic_outside[0].WCT_LR_APR, d_climatic_outside[0].WCT_LR_MAY, d_climatic_outside[0].WCT_LR_JUN, d_climatic_outside[0].WCT_LR_JUL, d_climatic_outside[0].WCT_LR_AUG, d_climatic_outside[0].WCT_LR_SEP, d_climatic_outside[0].WCT_LR_OCT, d_climatic_outside[0].WCT_LR_NOV, d_climatic_outside[0].WCT_LR_DEC]
},
{
label: 'Medium risk',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].WCT_MR_JAN, d_climatic_outside[0].WCT_MR_FEB, d_climatic_outside[0].WCT_MR_MAR, d_climatic_outside[0].WCT_MR_APR, d_climatic_outside[0].WCT_MR_MAY, d_climatic_outside[0].WCT_MR_JUN, d_climatic_outside[0].WCT_MR_JUL, d_climatic_outside[0].WCT_MR_AUG, d_climatic_outside[0].WCT_MR_SEP, d_climatic_outside[0].WCT_MR_OCT, d_climatic_outside[0].WCT_MR_NOV, d_climatic_outside[0].WCT_MR_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '5'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
d_climatic_outside = data_climatic.responseJSON[compare_location1].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr'],
datasets: [{
label: '100% cover',
backgroundColor: color(window.chartColors.purple).alpha(0.5).rgbString(),
borderColor: window.chartColors.purple,
borderWidth: 1,
data: [d_climatic_outside[0].SCOV_1_OCT, d_climatic_outside[0].SCOV_1_NOV, d_climatic_outside[0].SCOV_1_DEC, d_climatic_outside[0].SCOV_1_JAN, d_climatic_outside[0].SCOV_1_FEB, d_climatic_outside[0].SCOV_1_MAR, d_climatic_outside[0].SCOV_1_APR]
},
{
label: '50% cover',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].SCOV_5_OCT, d_climatic_outside[0].SCOV_5_NOV, d_climatic_outside[0].SCOV_5_DEC, d_climatic_outside[0].SCOV_5_JAN, d_climatic_outside[0].SCOV_5_FEB, d_climatic_outside[0].SCOV_5_MAR, d_climatic_outside[0].SCOV_5_APR]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
compare_location2 = $('#select-locatia-2').val()
d_climatic_outside = data_climatic.responseJSON[compare_location2].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr'],
datasets: [{
label: '100% cover',
backgroundColor: color(window.chartColors.purple).alpha(0.5).rgbString(),
borderColor: window.chartColors.purple,
borderWidth: 1,
data: [d_climatic_outside[0].SCOV_1_OCT, d_climatic_outside[0].SCOV_1_NOV, d_climatic_outside[0].SCOV_1_DEC, d_climatic_outside[0].SCOV_1_JAN, d_climatic_outside[0].SCOV_1_FEB, d_climatic_outside[0].SCOV_1_MAR, d_climatic_outside[0].SCOV_1_APR]
},
{
label: '50% cover',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].SCOV_5_OCT, d_climatic_outside[0].SCOV_5_NOV, d_climatic_outside[0].SCOV_5_DEC, d_climatic_outside[0].SCOV_5_JAN, d_climatic_outside[0].SCOV_5_FEB, d_climatic_outside[0].SCOV_5_MAR, d_climatic_outside[0].SCOV_5_APR]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '6'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
d_climatic_outside = data_climatic.responseJSON[compare_location1].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr'],
datasets: [{
label: 'Optimum for ski',
backgroundColor: color(window.chartColors.purple).alpha(0.5).rgbString(),
borderColor: window.chartColors.purple,
borderWidth: 1,
data: [d_climatic_outside[0].SDT_30_OCT, d_climatic_outside[0].SDT_30_NOV, d_climatic_outside[0].SDT_30_DEC, d_climatic_outside[0].SDT_30_JAN, d_climatic_outside[0].SDT_30_FEB, d_climatic_outside[0].SDT_30_MAR, d_climatic_outside[0].SDT_30_APR]
},
{
label: 'At least 5 cm',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].SDT_05_OCT, d_climatic_outside[0].SDT_05_NOV, d_climatic_outside[0].SDT_05_DEC, d_climatic_outside[0].SDT_05_JAN, d_climatic_outside[0].SDT_05_FEB, d_climatic_outside[0].SDT_05_MAR, d_climatic_outside[0].SDT_05_APR]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
compare_location2 = $('#select-locatia-2').val()
d_climatic_outside = data_climatic.responseJSON[compare_location2].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr'],
datasets: [{
label: 'Optimum for ski',
backgroundColor: color(window.chartColors.purple).alpha(0.5).rgbString(),
borderColor: window.chartColors.purple,
borderWidth: 1,
data: [d_climatic_outside[0].SDT_30_OCT, d_climatic_outside[0].SDT_30_NOV, d_climatic_outside[0].SDT_30_DEC, d_climatic_outside[0].SDT_30_JAN, d_climatic_outside[0].SDT_30_FEB, d_climatic_outside[0].SDT_30_MAR, d_climatic_outside[0].SDT_30_APR]
},
{
label: 'At least 5 cm',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].SDT_05_OCT, d_climatic_outside[0].SDT_05_NOV, d_climatic_outside[0].SDT_05_DEC, d_climatic_outside[0].SDT_05_JAN, d_climatic_outside[0].SDT_05_FEB, d_climatic_outside[0].SDT_05_MAR, d_climatic_outside[0].SDT_05_APR]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '7'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
d_climatic_outside = data_climatic.responseJSON[compare_location1].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['May', 'Jun', 'Jul', 'Aug', 'Sep'],
datasets: [{
label: '1st decade',
backgroundColor: color(window.chartColors.yellow).alpha(0.5).rgbString(),
borderColor: window.chartColors.yellow,
borderWidth: 1,
data: [d_climatic_outside[0].SST_M_MAY1, d_climatic_outside[0].SST_M_JUN1, d_climatic_outside[0].SST_M_JUL1, d_climatic_outside[0].SST_M_AUG1, d_climatic_outside[0].SST_M_SEP1]
},{
label: '2nd decade',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].SST_M_MAY2, d_climatic_outside[0].SST_M_JUN2, d_climatic_outside[0].SST_M_JUL2, d_climatic_outside[0].SST_M_AUG2, d_climatic_outside[0].SST_M_SEP2]
},{
label: '3rd decade',
backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
borderColor: window.chartColors.red,
borderWidth: 1,
data: [d_climatic_outside[0].SST_M_MAY3, d_climatic_outside[0].SST_M_JUN3, d_climatic_outside[0].SST_M_JUL3, d_climatic_outside[0].SST_M_AUG3, d_climatic_outside[0].SST_M_SEP3]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
compare_location2 = $('#select-locatia-2').val()
d_climatic_outside = data_climatic.responseJSON[compare_location2].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['May', 'Jun', 'Jul', 'Aug', 'Sep'],
datasets: [{
label: '1st decade',
backgroundColor: color(window.chartColors.yellow).alpha(0.5).rgbString(),
borderColor: window.chartColors.yellow,
borderWidth: 1,
data: [d_climatic_outside[0].SST_M_MAY1, d_climatic_outside[0].SST_M_JUN1, d_climatic_outside[0].SST_M_JUL1, d_climatic_outside[0].SST_M_AUG1, d_climatic_outside[0].SST_M_SEP1]
},{
label: '2nd decade',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].SST_M_MAY2, d_climatic_outside[0].SST_M_JUN2, d_climatic_outside[0].SST_M_JUL2, d_climatic_outside[0].SST_M_AUG2, d_climatic_outside[0].SST_M_SEP2]
},{
label: '3rd decade',
backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
borderColor: window.chartColors.red,
borderWidth: 1,
data: [d_climatic_outside[0].SST_M_MAY3, d_climatic_outside[0].SST_M_JUN3, d_climatic_outside[0].SST_M_JUL3, d_climatic_outside[0].SST_M_AUG3, d_climatic_outside[0].SST_M_SEP3]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
if ($('#selectare-tip-parametru').val() == '8'){
//coloana 1
compare_location1 = $('#select-locatia-1').val()
d_climatic_outside = data_climatic.responseJSON[compare_location1].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'No Green',
backgroundColor: color(window.chartColors.grey).alpha(0.5).rgbString(),
borderColor: window.chartColors.grey,
borderWidth: 1,
data: [d_climatic_outside[0].GREEN1_JAN, d_climatic_outside[0].GREEN1_FEB, d_climatic_outside[0].GREEN1_MAR, d_climatic_outside[0].GREEN1_APR, d_climatic_outside[0].GREEN1_MAY, d_climatic_outside[0].GREEN1_JUN, d_climatic_outside[0].GREEN1_JUL, d_climatic_outside[0].GREEN1_AUG, d_climatic_outside[0].GREEN1_SEP, d_climatic_outside[0].GREEN1_OCT, d_climatic_outside[0].GREEN1_NOV, d_climatic_outside[0].GREEN1_DEC]
},{
label: 'Greenish',
backgroundColor: color(window.chartColors.greenesh).alpha(0.5).rgbString(),
borderColor: window.chartColors.greenesh,
borderWidth: 1,
data: [d_climatic_outside[0].GREEN2_JAN, d_climatic_outside[0].GREEN2_FEB, d_climatic_outside[0].GREEN2_MAR, d_climatic_outside[0].GREEN2_APR, d_climatic_outside[0].GREEN2_MAY, d_climatic_outside[0].GREEN2_JUN, d_climatic_outside[0].GREEN2_JUL, d_climatic_outside[0].GREEN2_AUG, d_climatic_outside[0].GREEN2_SEP, d_climatic_outside[0].GREEN2_OCT, d_climatic_outside[0].GREEN2_NOV, d_climatic_outside[0].GREEN2_DEC]
},{
label: 'Green',
backgroundColor: color(window.chartColors.green).alpha(0.5).rgbString(),
borderColor: window.chartColors.green,
borderWidth: 1,
data: [d_climatic_outside[0].GREEN3_JAN, d_climatic_outside[0].GREEN3_FEB, d_climatic_outside[0].GREEN3_MAR, d_climatic_outside[0].GREEN3_APR, d_climatic_outside[0].GREEN3_MAY, d_climatic_outside[0].GREEN3_JUN, d_climatic_outside[0].GREEN3_JUL, d_climatic_outside[0].GREEN3_AUG, d_climatic_outside[0].GREEN3_SEP, d_climatic_outside[0].GREEN3_OCT, d_climatic_outside[0].GREEN3_NOV, d_climatic_outside[0].GREEN3_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
compare_location2 = $('#select-locatia-2').val()
d_climatic_outside = data_climatic.responseJSON[compare_location2].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'No Green',
backgroundColor: color(window.chartColors.grey).alpha(0.5).rgbString(),
borderColor: window.chartColors.grey,
borderWidth: 1,
data: [d_climatic_outside[0].GREEN1_JAN, d_climatic_outside[0].GREEN1_FEB, d_climatic_outside[0].GREEN1_MAR, d_climatic_outside[0].GREEN1_APR, d_climatic_outside[0].GREEN1_MAY, d_climatic_outside[0].GREEN1_JUN, d_climatic_outside[0].GREEN1_JUL, d_climatic_outside[0].GREEN1_AUG, d_climatic_outside[0].GREEN1_SEP, d_climatic_outside[0].GREEN1_OCT, d_climatic_outside[0].GREEN1_NOV, d_climatic_outside[0].GREEN1_DEC]
},{
label: 'Greenish',
backgroundColor: color(window.chartColors.greenesh).alpha(0.5).rgbString(),
borderColor: window.chartColors.greenesh,
borderWidth: 1,
data: [d_climatic_outside[0].GREEN2_JAN, d_climatic_outside[0].GREEN2_FEB, d_climatic_outside[0].GREEN2_MAR, d_climatic_outside[0].GREEN2_APR, d_climatic_outside[0].GREEN2_MAY, d_climatic_outside[0].GREEN2_JUN, d_climatic_outside[0].GREEN2_JUL, d_climatic_outside[0].GREEN2_AUG, d_climatic_outside[0].GREEN2_SEP, d_climatic_outside[0].GREEN2_OCT, d_climatic_outside[0].GREEN2_NOV, d_climatic_outside[0].GREEN2_DEC]
},{
label: 'Green',
backgroundColor: color(window.chartColors.green).alpha(0.5).rgbString(),
borderColor: window.chartColors.green,
borderWidth: 1,
data: [d_climatic_outside[0].GREEN3_JAN, d_climatic_outside[0].GREEN3_FEB, d_climatic_outside[0].GREEN3_MAR, d_climatic_outside[0].GREEN3_APR, d_climatic_outside[0].GREEN3_MAY, d_climatic_outside[0].GREEN3_JUN, d_climatic_outside[0].GREEN3_JUL, d_climatic_outside[0].GREEN3_AUG, d_climatic_outside[0].GREEN3_SEP, d_climatic_outside[0].GREEN3_OCT, d_climatic_outside[0].GREEN3_NOV, d_climatic_outside[0].GREEN3_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
}
})
//grafic implicit
$( "#control-compara-locatii" ).click(function() {
//coloana 1
compare_location1 = $('#select-locatia-1').val()
d_climatic_outside = data_climatic.responseJSON[compare_location1].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Good and very good',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].HCI_G_JAN, d_climatic_outside[0].HCI_G_FEB, d_climatic_outside[0].HCI_G_MAR, d_climatic_outside[0].HCI_G_APR, d_climatic_outside[0].HCI_G_MAY, d_climatic_outside[0].HCI_G_JUN, d_climatic_outside[0].HCI_G_JUL, d_climatic_outside[0].HCI_G_AUG, d_climatic_outside[0].HCI_G_SEP, d_climatic_outside[0].HCI_G_OCT, d_climatic_outside[0].HCI_G_NOV, d_climatic_outside.HCI_G_DEC]
},
{
label: 'Acceptable/Fair',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].HCI_F_JAN, d_climatic_outside[0].HCI_F_FEB, d_climatic_outside[0].HCI_F_MAR, d_climatic_outside[0].HCI_F_APR, d_climatic_outside[0].HCI_F_MAY, d_climatic_outside[0].HCI_F_JUN, d_climatic_outside[0].HCI_F_JUL, d_climatic_outside[0].HCI_F_AUG, d_climatic_outside[0].HCI_F_SEP, d_climatic_outside[0].HCI_F_OCT, d_climatic_outside[0].HCI_F_NOV, d_climatic_outside[0].HCI_F_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-1").innerHTML = "" +
"" +
"
";
graficRezultateCompare(chartData, chartOptions);
//coloana 2
compare_location2 = $('#select-locatia-2').val()
d_climatic_outside = data_climatic.responseJSON[compare_location2].map(function(e) {
return e;
});
var color = Chart.helpers.color;
var chartData = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Good and very good',
backgroundColor: color(window.chartColors.blue).alpha(0.5).rgbString(),
borderColor: window.chartColors.blue,
borderWidth: 1,
data: [d_climatic_outside[0].HCI_G_JAN, d_climatic_outside[0].HCI_G_FEB, d_climatic_outside[0].HCI_G_MAR, d_climatic_outside[0].HCI_G_APR, d_climatic_outside[0].HCI_G_MAY, d_climatic_outside[0].HCI_G_JUN, d_climatic_outside[0].HCI_G_JUL, d_climatic_outside[0].HCI_G_AUG, d_climatic_outside[0].HCI_G_SEP, d_climatic_outside[0].HCI_G_OCT, d_climatic_outside[0].HCI_G_NOV, d_climatic_outside.HCI_G_DEC]
},
{
label: 'Acceptable/Fair',
backgroundColor: color(window.chartColors.orange).alpha(0.5).rgbString(),
borderColor: window.chartColors.orange,
borderWidth: 1,
data: [d_climatic_outside[0].HCI_F_JAN, d_climatic_outside[0].HCI_F_FEB, d_climatic_outside[0].HCI_F_MAR, d_climatic_outside[0].HCI_F_APR, d_climatic_outside[0].HCI_F_MAY, d_climatic_outside[0].HCI_F_JUN, d_climatic_outside[0].HCI_F_JUL, d_climatic_outside[0].HCI_F_AUG, d_climatic_outside[0].HCI_F_SEP, d_climatic_outside[0].HCI_F_OCT, d_climatic_outside[0].HCI_F_NOV, d_climatic_outside[0].HCI_F_DEC]
}]
}
var chartOptions = {
animation: false,
legend: {
labels: {
boxWidth: 10
}
},
scales: {
xAxes: [{
ticks: {
autoSkip: false
}
}],
yAxes: [{
ticks: {
beginAtZero: true,
max: 30
}
}]
}
}
document.getElementById("info-compare-2").innerHTML = "" +
"" +
"
";
graficRezultateCompare2(chartData, chartOptions);
})
/////////////////////////////////
var legend = L.control({position: 'bottomleft'});
legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend'),
grades = ['munte', 'litoral', 'rural', 'urban'],
labels = ['Mountain', 'Sea', 'Rural', 'Urban'];
for (var i = 0; i < grades.length; i++) {
div.innerHTML +=
' ' +
labels[i] + '
';
}
return div;
};
legend.addTo(map);
$('select').on('changed.bs.select',
function(e, clickedIndex, newValue, oldValue) {
if (clickedIndex == '0' && newValue == true)
map.addLayer(sectii_contur);
if (clickedIndex == '0' && newValue == false)
map.removeLayer(sectii_contur);
if (clickedIndex == '1' && newValue == true)
map.addLayer(uat_contur);
if (clickedIndex == '1' && newValue == false)
map.removeLayer(uat_contur);
if (clickedIndex == '2' && newValue == true)
map.addLayer(judete_contur);
if (clickedIndex == '2' && newValue == false)
map.removeLayer(judete_contur);
if (clickedIndex == '3' && newValue == true)
map.addLayer(sectii_punct);
if (clickedIndex == '3' && newValue == false)
map.removeLayer(sectii_punct);
});
$('#slider').on('slidechange', function( event, ui ) {
locations_data.setStyle({fillOpacity: $('#slider').slider('value')});
if ($('#rezultat').val() == '5'){
map.removeLayer(fiecare_procent_sectie);
map.addLayer(fiecare_procent_sectie);
}
if ($('#rezultat').val() == '6'){
map.removeLayer(fiecare_procent_uat);
map.addLayer(fiecare_procent_uat);
}
if ($('#rezultat').val() == '7'){
map.removeLayer(fiecare_procent_judete);
map.addLayer(fiecare_procent_judete);
}
});
$('#fundal').change(function () {
if ($('#fundal').val() == '1'){
map.addLayer(lightOSM);
map.removeLayer(Esri_WorldTopoMap);
map.removeLayer(Esri_WorldImagery);
}
if ($('#fundal').val() == '2'){
map.addLayer(Esri_WorldTopoMap);
map.removeLayer(lightOSM);
map.removeLayer(Esri_WorldImagery);
}
if ($('#fundal').val() == '3'){
map.addLayer(Esri_WorldImagery);
map.removeLayer(lightOSM);
map.removeLayer(Esri_WorldTopoMap);
}
});
$('#rezultate_uat_info').css('display', 'none');
}
}
}