'; 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/zerbstanhalt/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 , 4 , 2 , 14 ]; qmPriceChartData.labels = [ "0 € / m² - 100 € / m²" , "100 € / m² - 200 € / m²" , "200 € / m² - 300 € / m²" , "300 € / m² - 400 € / m²" , "400 € / m²+" ]; qmPriceChartData.data = [ 20 , 0 , 0 , 0 , 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: [ 55.93854163440508 , 61.705869056396125 , 56.509705071000624 , 41.805445021395705 , 41.805445021395705 , 39.840911919531685 , 48.9856435924733 , 65.8805409569213 , 67.58697483114992 , 67.28452776254805 , 67.28452776254805 , 94.33584771939002 , 73.20538537786697 , 92.32265857720046 , 80.70960969821543 , 75.31258236229179 , 72.4305621867038 , 9.85108264067681 , 11.603097909295737 ], yAxisID: 'y', }, { label: " €/m² Median", borderColor: "#76b4e8", backgroundColor: "#76b4e8", tension: 0.3, type: 'line', data: [ 50.602409638554214, 49.504950495049506, 49.642857142857146, 43.57541899441341, 43.57541899441341, 43.57541899441341, 43.57541899441341, 75, 75, 75, 75, 102.97166551485833, 98.21428571428571, 102.95956936641859, 98.21428571428571, 89, 102.96881910659, 4.896907216494846, 1.6666666666666667 ], } ] }, options: { legend: {display: true}, title: { display: true, text: 'Entwicklung der Quadratmeterpreise in Zerbst/Anhalt', fontSize: 16, fontStyle: "normal", fontFamily: "'Open Sans',sans-serif" } } }); });