'; 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/hardt/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 , 2 , 7 , 2 , 4 ]; qmPriceChartData.labels = [ "0 € / m² - 100 € / m²" , "100 € / m² - 200 € / m²" , "200 € / m² - 300 € / m²" , "300 € / m² - 400 € / m²" , "400 € / m²+" ]; qmPriceChartData.data = [ 1 , 6 , 5 , 0 , 3 ]; buildCharts(areaChartData, qmPriceChartData); new Chart(document.getElementById("trend-chart"), { type: 'line', data: { labels: [ 'Apr. 2021', 'Aug. 2021', 'Nov. 2021', 'Dez. 2021', 'Jan. 2022', 'Feb. 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: [ 109.88436750376141 , 207.8559253389583 , 157.0829923495138 , 157.846287812927 , 156.39702562882113 , 164.4183360127144 , 158.375146398752 , 150.6098453488423 , 137.55837013933856 , 309.08632649210773 , 309.08632649210773 , 288.0983818404796 , 336.56214509925394 , 425.9413339504151 , 362.807493592512 , 253.7165330309644 , 242.56862265457934 , 220.31938435227858 , 232.70698660568863 ], yAxisID: 'y', }, { label: " €/m² Median", borderColor: "#76b4e8", backgroundColor: "#76b4e8", tension: 0.3, type: 'line', data: [ 75.5750273822563, 160.01706848730532, 150, 160.01706848730532, 141.42714285714285, 143.1718061674009, 143.1718061674009, 141.42714285714285, 141.42714285714285, 180.10291595197256, 180.10291595197256, 220, 230, 236.16734143049933, 220, 235.8490566037736, 217.3913043478261, 200.25031289111388, 200.25031289111388 ], } ] }, options: { legend: {display: true}, title: { display: true, text: 'Entwicklung der Quadratmeterpreise in Hardt', fontSize: 16, fontStyle: "normal", fontFamily: "'Open Sans',sans-serif" } } }); });