'; 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/merseburg/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 , 0 , 11 , 4 , 3 ]; qmPriceChartData.labels = [ "0 € / m² - 100 € / m²" , "100 € / m² - 200 € / m²" , "200 € / m² - 300 € / m²" , "300 € / m² - 400 € / m²" , "400 € / m²+" ]; qmPriceChartData.data = [ 3 , 7 , 2 , 0 , 6 ]; 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', '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', 'Apr. 2023', 'Mai 2023', 'Juni 2023', 'Juli 2023', 'Aug. 2023', 'Sept. 2023', 'Okt. 2023', 'Nov. 2023', 'Dez. 2023', 'Jan. 2024', 'Feb. 2024', 'März 2024', 'Apr. 2024', 'Mai 2024', 'Juni 2024', 'Juli 2024', 'Aug. 2024', 'Sept. 2024', 'Okt. 2024', 'Nov. 2024', 'Dez. 2024', 'Jan. 2025', 'Feb. 2025', 'März 2025' ], datasets: [ { label: " €/m² im Durchschnitt", borderColor: "#0b4b82", backgroundColor: "#0b4b82", tension: 0.3, data: [ 101.20724658125468 , 92.99610935730796 , 169.98348764701862 , 175.53368490958349 , 174.13430458419396 , 149.60888937378354 , 167.10135061832602 , 148.89701843984957 , 184.1750565812833 , 184.1750565812833 , 180.05779150862395 , 173.82084718353065 , 184.7751919174798 , 210.81708979252085 , 186.85333041712022 , 179.20248894666986 , 200.7956477426651 , 208.2621233989863 , 170.41772986454342 , 169.65932022118207 , 187.3489998242131 , 182.16174684571124 , 179.93725701196726 , 194.51287239055972 , 176.63798174893347 , 137.53195484330863 , 188.5925700012536 , 169.39954247162976 , 292.617472918929 , 173.49271563793778 , 204.23383701999222 , 256.7783656684063 , 314.30119302737654 , 247.27118098768645 , 355.85139186527266 , 273.08004826383393 , 323.4440501702337 , 286.62650880191484 , 216.6050336930852 , 299.0147955630139 , 269.2978114392887 , 269.43261623091917 ], yAxisID: 'y', }, { label: " €/m² Median", borderColor: "#76b4e8", backgroundColor: "#76b4e8", tension: 0.3, type: 'line', data: [ 103.57058823529412, 76.59900421294523, 123.59550561797752, 129, 129, 123.59550561797752, 130, 129, 140.1098901098901, 140.1098901098901, 130.80720092915215, 132.1530758226037, 132.1530758226037, 150, 149, 149, 169.754039497307, 169, 150.35066371681415, 172.53303964757708, 170.830078125, 156.40113798008534, 165.61013215859032, 144.03563129357087, 142.176386913229, 129, 137.7079482439926, 129, 236.38888888888889, 155.61013215859032, 155.609375, 130.95238095238096, 503.44827586206895, 155.61, 503.44827586206895, 205.4794520547945, 503.44827586206895, 205.4794520547945, 145.60951327433628, 236.38888888888889, 145.73643410852713, 145.73643410852713 ], } ] }, options: { legend: {display: true}, title: { display: true, text: 'Entwicklung der Quadratmeterpreise in Merseburg', fontSize: 16, fontStyle: "normal", fontFamily: "'Open Sans',sans-serif" } } }); });