'; 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/bad-fallingbostel/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 , 3 , 1 , 6 ]; qmPriceChartData.labels = [ "0 € / m² - 100 € / m²" , "100 € / m² - 200 € / m²" , "200 € / m² - 300 € / m²" , "300 € / m² - 400 € / m²" , "400 € / m²+" ]; qmPriceChartData.data = [ 6 , 4 , 0 , 0 , 0 ]; buildCharts(areaChartData, qmPriceChartData); new Chart(document.getElementById("trend-chart"), { type: 'line', data: { labels: [ 'Apr. 2021', 'Aug. 2021', 'Nov. 2021', '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: [ 134.5733205380238 , 137.27916158013267 , 94.73856858846918 , 272.1345923660229 , 272.1345923660229 , 284.43152767896277 , 281.2257936976871 , 310.6030914967484 , 107.91904930418649 , 107.02407932386375 , 101.5871188532515 , 118.24534816713147 , 98.15677277831006 ], yAxisID: 'y', }, { label: " €/m² Median", borderColor: "#76b4e8", backgroundColor: "#76b4e8", tension: 0.3, type: 'line', data: [ 110.5, 77.16535433070867, 0 , 77.66666666666667, 77.66666666666667, 162.5, 144, 247.74774774774775, 93.2, 114, 99.93293091884641, 124, 93.2 ], } ] }, options: { legend: {display: true}, title: { display: true, text: 'Entwicklung der Quadratmeterpreise in Bad Fallingbostel', fontSize: 16, fontStyle: "normal", fontFamily: "'Open Sans',sans-serif" } } }); });