dashboard einzelansicht trend auslastung.
This commit is contained in:
1 parent
4b7067fb63
commit
47a5035787
7 files changed
+148
-11
No files matched your search
@@ -45,6 +45,11 @@ class Api
|
||||
return self::get("/property/{$id}/extractions");
|
||||
}
|
||||
|
||||
public static function propertyCapacities(int $id)
|
||||
{
|
||||
return self::get("/property/{$id}/capacities");
|
||||
}
|
||||
|
||||
public static function propertyBase(int $id): mixed
|
||||
{
|
||||
return self::get("/property/{$id}/base");
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
@endforeach
|
||||
</dl>
|
||||
</article>
|
||||
<article class="header">
|
||||
<article class="header" style="grid-row-start: 1; grid-row-end: 3;">
|
||||
<header>
|
||||
<h2 id="belegung-title">
|
||||
Belegung am {{ json_decode($extractiondates)[0] }}
|
||||
@@ -29,7 +29,52 @@
|
||||
</header>
|
||||
<div id="chart-calendar"></div>
|
||||
</article>
|
||||
<article class="header">
|
||||
<header>
|
||||
<h2>
|
||||
Entwicklung der Verfügbarkeit
|
||||
</h2>
|
||||
</header>
|
||||
<div id="chart-capacity"></div>
|
||||
</article>
|
||||
<script type="module">
|
||||
const chartCapacity = document.getElementById('chart-capacity');
|
||||
const cCapacity = echarts.init(chartCapacity);
|
||||
|
||||
const cCapacityOptions = {
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
grid: {
|
||||
left: '0',
|
||||
right: 10,
|
||||
bottom: '0',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: {!! json_encode($capacities['dates']) !!}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 100
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'Alle',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
symbolSize: 7,
|
||||
data: {!! json_encode($capacities['capacities']) !!}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
cCapacity.setOption(cCapacityOptions);
|
||||
|
||||
|
||||
const chartCalendar = document.getElementById('chart-calendar');
|
||||
const cCalendar = echarts.init(chartCalendar);
|
||||
const h2Belegung = document.getElementById('belegung-title');
|
||||
@@ -70,18 +115,26 @@ const cCalendarOptions = {
|
||||
orient: 'horizontal',
|
||||
range: '2024',
|
||||
top: 50,
|
||||
right: 0,
|
||||
right: 10,
|
||||
left: 50,
|
||||
bottom: "55%"
|
||||
bottom: "66%"
|
||||
},
|
||||
{
|
||||
orient: 'horizontal',
|
||||
range: '2025',
|
||||
right: 100,
|
||||
right: 10,
|
||||
left: 50,
|
||||
bottom: 60,
|
||||
top: '55%'
|
||||
top: '43%',
|
||||
bottom: '43%'
|
||||
},
|
||||
{
|
||||
orient: 'horizontal',
|
||||
range: '2026',
|
||||
right: 10,
|
||||
left: 50,
|
||||
top: '66%',
|
||||
bottom: '10%'
|
||||
}
|
||||
],
|
||||
options: [
|
||||
@foreach ($calendar as $c)
|
||||
@@ -97,6 +150,12 @@ const cCalendarOptions = {
|
||||
coordinateSystem: 'calendar',
|
||||
calendarIndex: 1,
|
||||
data: {!! json_encode($c) !!}
|
||||
},
|
||||
{
|
||||
type: 'heatmap',
|
||||
coordinateSystem: 'calendar',
|
||||
calendarIndex: 2,
|
||||
data: {!! json_encode($c) !!}
|
||||
}]
|
||||
},
|
||||
@endforeach
|
||||
@@ -105,9 +164,35 @@ const cCalendarOptions = {
|
||||
|
||||
cCalendar.setOption(cCalendarOptions);
|
||||
cCalendar.on('timelinechanged', (e) => {
|
||||
|
||||
h2Belegung.innerText = "Belegung am "+cCalendarOptions.timeline.data[e.currentIndex];
|
||||
/*
|
||||
series = cCalendarOptions.series[0].data
|
||||
series[e.currentIndex]
|
||||
series: [
|
||||
{
|
||||
name: 'Alle',
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
symbolSize: 7,
|
||||
data: {!! json_encode($capacities['capacities']) !!}
|
||||
}
|
||||
]
|
||||
cCapacity.setOption({
|
||||
|
||||
|
||||
})
|
||||
*/
|
||||
})
|
||||
|
||||
cCapacity.on('click', 'series', (e) => {
|
||||
|
||||
cCalendar.dispatchAction({
|
||||
type: 'timelineChange',
|
||||
currentIndex: e.dataIndex
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
@@ -17,7 +17,6 @@ Route::get('/', function () {
|
||||
}
|
||||
|
||||
$propertiesGeo = Api::propertiesGeo();
|
||||
//dump($propertiesGeo);
|
||||
|
||||
return view('overview', ["geo" => $propertiesGeo, "growth" => $propertiesGrowth, "propsPerRegion" => [json_encode($propsPerRegionName), json_encode($propsPerRegionCounts)]]);
|
||||
});
|
||||
@@ -26,6 +25,7 @@ Route::get('/prop/{id}', function (int $id) {
|
||||
|
||||
$propertyBase = Api::propertyBase($id);
|
||||
$extractions = Api::propertyExtractions($id);
|
||||
$propertyCapacities = Api::propertyCapacities($id);
|
||||
$data = [];
|
||||
$dates = [];
|
||||
|
||||
@@ -46,5 +46,5 @@ Route::get('/prop/{id}', function (int $id) {
|
||||
|
||||
}
|
||||
|
||||
return view('property', ['base' => $propertyBase[0], "extractiondates" => json_encode($dates), "calendar" => $data]);
|
||||
return view('property', ['base' => $propertyBase[0], "extractiondates" => json_encode($dates), "calendar" => $data, 'capacities' => $propertyCapacities]);
|
||||
});
|
||||
Reference in new issue
Block a user