2024-12-18 15:14:13 +01:00
|
|
|
@extends('base')
|
|
|
|
@section('main')
|
|
|
|
<article class="header">
|
|
|
|
<header>
|
|
|
|
<h2>
|
2024-12-18 20:10:11 +01:00
|
|
|
Anzahl jemals gefundene Kurzzeitmietobjekte pro Region
|
2024-12-18 15:14:13 +01:00
|
|
|
</h2>
|
|
|
|
</header>
|
|
|
|
<div id="chart-props-per-region"></div>
|
|
|
|
</article>
|
|
|
|
<article class="header">
|
|
|
|
<header>
|
|
|
|
<h2>
|
2024-12-18 20:10:11 +01:00
|
|
|
Entwicklung der Anzahl jemals gefunden Kurzzeitmietobjekte
|
2024-12-18 15:14:13 +01:00
|
|
|
</h2>
|
|
|
|
</header>
|
|
|
|
<div id="extractions"></div>
|
|
|
|
</article>
|
|
|
|
<article>
|
|
|
|
<div id="leaflet"></div>
|
|
|
|
</article>
|
|
|
|
|
|
|
|
<script type="module">
|
|
|
|
const chartPropsPerRegion = document.getElementById('chart-props-per-region');
|
|
|
|
const cPropsPerRegion = echarts.init(chartPropsPerRegion);
|
|
|
|
const cPropsPerRegionOptions = {
|
|
|
|
grid: {
|
|
|
|
top: 20,
|
|
|
|
left: 30,
|
|
|
|
right: 0,
|
|
|
|
bottom: 20
|
|
|
|
|
|
|
|
},
|
|
|
|
xAxis: {
|
|
|
|
type: 'category',
|
|
|
|
data: {!! $propsPerRegion[0] !!}
|
|
|
|
},
|
|
|
|
yAxis: {
|
|
|
|
type: 'value'
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
data: {!! $propsPerRegion[1] !!},
|
|
|
|
type: 'bar'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
cPropsPerRegion.setOption(cPropsPerRegionOptions);
|
|
|
|
|
|
|
|
const chartExtractions = document.getElementById('extractions');
|
|
|
|
const cExtractions = echarts.init(chartExtractions);
|
|
|
|
|
|
|
|
const filters = {
|
2024-12-18 19:52:06 +01:00
|
|
|
regions: ["Alle", "Davos", "Engadin", "Heidiland", "St. Moritz"]
|
2024-12-18 15:14:13 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const cExtractionsOptions = {
|
|
|
|
tooltip: {
|
|
|
|
trigger: 'axis'
|
|
|
|
},
|
|
|
|
legend: {
|
|
|
|
data: filters.regions
|
|
|
|
},
|
|
|
|
grid: {
|
|
|
|
left: '0',
|
|
|
|
right: 10,
|
|
|
|
bottom: '0',
|
|
|
|
containLabel: true
|
|
|
|
},
|
|
|
|
xAxis: {
|
|
|
|
type: 'category',
|
|
|
|
boundaryGap: false,
|
2024-12-18 19:52:06 +01:00
|
|
|
data: {!! json_encode($growth['dates']) !!}
|
2024-12-18 15:14:13 +01:00
|
|
|
},
|
|
|
|
yAxis: {
|
|
|
|
type: 'value'
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
name: 'Alle',
|
|
|
|
type: 'line',
|
|
|
|
stack: 'Total',
|
2024-12-18 19:52:06 +01:00
|
|
|
data: {!! json_encode($growth['total_all']) !!}
|
2024-12-18 15:14:13 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Heidiland',
|
|
|
|
type: 'line',
|
|
|
|
stack: 'Heidiland',
|
2024-12-18 19:52:06 +01:00
|
|
|
data: {!! json_encode($growth['total_heidiland']) !!}
|
2024-12-18 15:14:13 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Davos',
|
|
|
|
type: 'line',
|
|
|
|
stack: 'Davos',
|
2024-12-18 19:52:06 +01:00
|
|
|
data: {!! json_encode($growth['total_davos']) !!}
|
2024-12-18 15:14:13 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Engadin',
|
|
|
|
type: 'line',
|
|
|
|
stack: 'Engadin',
|
2024-12-18 19:52:06 +01:00
|
|
|
data: {!! json_encode($growth['total_engadin']) !!}
|
2024-12-18 15:14:13 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'St. Moritz',
|
|
|
|
type: 'line',
|
|
|
|
stack: 'St. Moritz',
|
2024-12-18 19:52:06 +01:00
|
|
|
data: {!! json_encode($growth['total_stmoritz']) !!}
|
2024-12-18 15:14:13 +01:00
|
|
|
},
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
cExtractions.setOption(cExtractionsOptions);
|
2024-12-18 19:52:06 +01:00
|
|
|
|
|
|
|
const map = L.map('leaflet').setView([46.862962, 9.535296], 9);
|
|
|
|
|
|
|
|
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
|
|
maxZoom: 19,
|
|
|
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
|
|
|
}).addTo(map);
|
|
|
|
|
|
|
|
const properties = {!! json_encode($geo) !!}
|
|
|
|
properties.forEach( prop => {
|
|
|
|
console.log(prop);
|
|
|
|
let coords = prop.coordinates.split(',');
|
|
|
|
L.marker(coords).addTo(map).bindPopup('<a href="/prop/'+prop.id+'">'+prop.coordinates+'</a>');
|
|
|
|
})
|
|
|
|
|
|
|
|
|
2024-12-18 15:14:13 +01:00
|
|
|
</script>
|
|
|
|
@endsection
|