'; 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/oberleichtersbach/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 , 2 , 1 , 2 ]; qmPriceChartData.labels = [ "0 € / m² - 100 € / m²" , "100 € / m² - 200 € / m²" , "200 € / m² - 300 € / m²" , "300 € / m² - 400 € / m²" , "400 € / m²+" ]; qmPriceChartData.data = [ 4 , 0 , 1 , 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', 'Juni 2023', 'Sept. 2023', 'Okt. 2023' ], datasets: [ { label: " €/m² im Durchschnitt", borderColor: "#0b4b82", backgroundColor: "#0b4b82", tension: 0.3, data: [ 48.57033734518192 , 32.21075999298176 , 36.87311584854999 , 40.10397273758166 , 41.924743461545795 , 40.35990804382269 , 44.71157733015075 , 62.43070168005082 , 53.81301121724879 , 49.79891142704762 , 49.79891142704762 , 51.6580043385339 , 50.416866698572576 , 56.053138558130264 , 63.942045465914816 , 65.65180499489695 , 70.47267275932192 , 60.56153430066059 , 87.84237703503833 , 56.28157356191074 , 103.35912091714218 ], yAxisID: 'y', }, { label: " €/m² Median", borderColor: "#76b4e8", backgroundColor: "#76b4e8", tension: 0.3, type: 'line', data: [ 49.5926319518243, 25, 38.19444444444444, 38.19444444444444, 43.037974683544306, 43.037974683544306, 45, 52, 52, 52, 52, 52.30769230769231, 52.30769230769231, 52.30769230769231, 65.51724137931035, 61.224489795918366, 55, 52.30769230769231, 84.45945945945945, 72.41379310344827, 90.66666666666667 ], } ] }, options: { legend: {display: true}, title: { display: true, text: 'Entwicklung der Quadratmeterpreise in Oberleichtersbach', fontSize: 16, fontStyle: "normal", fontFamily: "'Open Sans',sans-serif" } } }); });