'; 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/puderbach/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 , 14 , 7 , 16 ]; qmPriceChartData.labels = [ "0 € / m² - 100 € / m²" , "100 € / m² - 200 € / m²" , "200 € / m² - 300 € / m²" , "300 € / m² - 400 € / m²" , "400 € / m²+" ]; qmPriceChartData.data = [ 25 , 11 , 2 , 2 , 0 ]; 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: [ 70.49703621035401 , 80.38392802375274 , 79.04998911933765 , 79.78522122078647 , 74.20792713860654 , 64.82548166990271 , 96.51259454509912 , 78.36304586263654 , 74.2073672411809 , 95.09400515572173 , 95.09400515572173 , 97.14971625825946 , 87.44485314043129 , 81.74307091654742 , 107.41241413137679 , 97.36610517803553 , 89.05009262763686 , 92.85575882676963 , 90.03765722266584 ], yAxisID: 'y', }, { label: " €/m² Median", borderColor: "#76b4e8", backgroundColor: "#76b4e8", tension: 0.3, type: 'line', data: [ 50, 65.85365853658537, 66.0377358490566, 65.85365853658537, 65.85365853658537, 65.85365853658537, 85, 86.48648648648648, 86.48648648648648, 86.48648648648648, 86.48648648648648, 84.90566037735849, 88.09691629955947, 78.68383404864092, 88.09691629955947, 89.37960042060989, 85, 95.81320450885669, 84.17602996254682 ], } ] }, options: { legend: {display: true}, title: { display: true, text: 'Entwicklung der Quadratmeterpreise in Puderbach', fontSize: 16, fontStyle: "normal", fontFamily: "'Open Sans',sans-serif" } } }); });