'; 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/westheim/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 , 5 , 0 , 0 ]; qmPriceChartData.labels = [ "0 € / m² - 100 € / m²" , "100 € / m² - 200 € / m²" , "200 € / m² - 300 € / m²" , "300 € / m² - 400 € / m²" , "400 € / m²+" ]; qmPriceChartData.data = [ 0 , 0 , 0 , 0 , 5 ]; 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', 'Feb. 2025' ], datasets: [ { label: " €/m² im Durchschnitt", borderColor: "#0b4b82", backgroundColor: "#0b4b82", tension: 0.3, data: [ 530.3191118253097 , 447.8957557066025 , 697.7658433445995 , 534.2989561751879 , 475.9162915996879 , 575.0798172450901 , 624.7114594008387 , 734.5389113431813 , 764.7206684805338 , 696.9888484126893 , 696.9888484126893 , 769.1727861170173 , 804.6933262415956 , 643.5047535134306 , 607.4829104217207 , 687.0350940319572 , 652.8258045102746 , 582.6311074405501 , 482.4063891156631 , 746.9455700457014 ], yAxisID: 'y', }, { label: " €/m² Median", borderColor: "#76b4e8", backgroundColor: "#76b4e8", tension: 0.3, type: 'line', data: [ 420.6730769230769, 396.63461538461536, 646.9002695417789, 494.199535962877, 494.199535962877, 519.7132616487455, 700, 700, 754.5454545454545, 718.1818181818181, 718.1818181818181, 788.9546351084813, 777.245508982036, 702.2132796780684, 625, 700, 686.695278969957, 581.2790697674419, 516.6666666666666, 862.2950819672132 ], } ] }, options: { legend: {display: true}, title: { display: true, text: 'Entwicklung der Quadratmeterpreise in Westheim', fontSize: 16, fontStyle: "normal", fontFamily: "'Open Sans',sans-serif" } } }); });