'; 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/adelshofen/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 , 15 , 28 , 12 , 8 ]; qmPriceChartData.labels = [ "0 € / m² - 100 € / m²" , "100 € / m² - 200 € / m²" , "200 € / m² - 300 € / m²" , "300 € / m² - 400 € / m²" , "400 € / m²+" ]; qmPriceChartData.data = [ 2 , 1 , 0 , 4 , 56 ]; buildCharts(areaChartData, qmPriceChartData); new Chart(document.getElementById("trend-chart"), { type: 'line', data: { labels: [ 'Apr. 2021', 'Aug. 2021', 'Nov. 2021', 'Dez. 2021', 'Jan. 2022', 'März 2022', 'Apr. 2022', 'Mai 2022', 'Juni 2022', 'Juli 2022', 'Aug. 2022', 'Sept. 2022', 'Okt. 2022', 'Nov. 2022', 'Dez. 2022', 'Jan. 2023', 'Feb. 2023', 'März 2023' ], datasets: [ { label: " €/m² im Durchschnitt", borderColor: "#0b4b82", backgroundColor: "#0b4b82", tension: 0.3, data: [ 805.3210511344865 , 903.2141902874669 , 1080.1966677373853 , 1099.9857146778972 , 1074.0582014939598 , 1042.423743636635 , 1135.1206889895523 , 1247.7866027143887 , 1246.257094775878 , 1246.257094775878 , 1371.9836865833495 , 1433.3372787426395 , 1574.7196300834855 , 1607.402273471357 , 1501.341882590063 , 1448.8397700189394 , 1468.1930344100947 , 1318.9890706361434 ], yAxisID: 'y', }, { label: " €/m² Median", borderColor: "#76b4e8", backgroundColor: "#76b4e8", tension: 0.3, type: 'line', data: [ 563.3802816901408, 712.8571428571429, 1333.3333333333333, 1333.3333333333333, 1394.0520446096655, 1455.8823529411766, 1086.9565217391305, 1111.111111111111, 1086.9565217391305, 1086.9565217391305, 1300, 1396.625, 1364.7058823529412, 1396.6165413533834, 1401.7391304347825, 1346.943231441048, 1381.877729257642, 1237.0311252992817 ], } ] }, options: { legend: {display: true}, title: { display: true, text: 'Entwicklung der Quadratmeterpreise in Adelshofen', fontSize: 16, fontStyle: "normal", fontFamily: "'Open Sans',sans-serif" } } }); });