'; let req = new XMLHttpRequest(); req.onreadystatechange = function () { if (req.readyState === 4 && req.status === 200) { let result = JSON.parse(req.response); document.getElementById("landprices").innerHTML = result.data; buildCharts(result.charts.areaChartData, result.charts.qmPriceChartData); loading = false; } else if (req.readyState === 4) { loading = false; } }; const url = "/stadt/immenstadt-im-allgaeu/aggregation?year=" + val[1] + "&month=" + val[0]; req.open('GET', url, true); setTimeout(function () { req.send(); }, 1200); } }) } const areaChartData = { labels: [], data: [] }; const qmPriceChartData = { labels: [], data: [] }; areaChartData.labels = [ "0 m² - 100 m²" , "100 m² - 500 m²" , "500 m² - 1000 m²" , "1000 m² - 2000 m²" , "2000 m²+" ]; areaChartData.data = [ 0 , 3 , 34 , 12 , 13 ]; qmPriceChartData.labels = [ "0 € / m² - 100 € / m²" , "100 € / m² - 200 € / m²" , "200 € / m² - 300 € / m²" , "300 € / m² - 400 € / m²" , "400 € / m²+" ]; qmPriceChartData.data = [ 38 , 13 , 6 , 1 , 4 ]; buildCharts(areaChartData, qmPriceChartData); new Chart(document.getElementById("trend-chart"), { type: 'line', data: { labels: [ 'Apr. 2021', 'Aug. 2021', 'Dez. 2021', 'Jan. 2022', 'Feb. 2022', 'Mai 2022', 'Juni 2022', 'Juli 2022' ], datasets: [ { label: " €/m² im Durchschnitt", borderColor: "#0b4b82", backgroundColor: "#0b4b82", tension: 0.3, data: [ 78.39870161567096 , 129.12613678130725 , 101.42357080123223 , 101.42357080123223 , 84.76520572900256 , 128.1547946421582 , 117.07209118654033 , 117.07209118654033 ], yAxisID: 'y', }, { label: " €/m² Median", borderColor: "#76b4e8", backgroundColor: "#76b4e8", tension: 0.3, type: 'line', data: [ 44.03669724770642, 45.835662381218555, 52.85225718194255, 52.85225718194255, 46.79144385026738, 88.57142857142857, 74.8502994011976, 74.8502994011976 ], } ] }, options: { legend: {display: true}, title: { display: true, text: 'Entwicklung der Quadratmeterpreise in Immenstadt im Allgäu', fontSize: 16, fontStyle: "normal", fontFamily: "'Open Sans',sans-serif" } } }); });