diff --git a/dashboard/resources/views/property.blade.php b/dashboard/resources/views/property.blade.php index 46109a2..f92d337 100644 --- a/dashboard/resources/views/property.blade.php +++ b/dashboard/resources/views/property.blade.php @@ -61,15 +61,13 @@ const cCapacityOptions = { min: 0, max: 100 }, - series: [ - { + series: { name: 'Alle', type: 'line', stack: 'Total', symbolSize: 7, data: {!! json_encode($capacities['capacities']) !!} } - ] }; cCapacity.setOption(cCapacityOptions); @@ -82,7 +80,7 @@ const h2Belegung = document.getElementById('belegung-title'); const cCalendarOptions = { timeline: { data: {!! $extractiondates !!}, - playInterval: 1000, + playInterval: 2000, axisType: 'time', left: 0, right: 0, @@ -114,26 +112,26 @@ const cCalendarOptions = { { orient: 'horizontal', range: '2024', - top: 50, + top: '6.25%', right: 10, + bottom: '68.75%', left: 50, - bottom: "66%" }, { orient: 'horizontal', range: '2025', + top: '37.5%', right: 10, + bottom: '37.25%', left: 50, - top: '43%', - bottom: '43%' }, { orient: 'horizontal', range: '2026', + top: '68.75%', right: 10, + bottom: '6.25%', left: 50, - top: '66%', - bottom: '10%' } ], options: [ @@ -164,28 +162,26 @@ const cCalendarOptions = { cCalendar.setOption(cCalendarOptions); cCalendar.on('timelinechanged', (e) => { + // Change header text according to datapoint 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']) !!} - } - ] + + // Set markpoint on linechart + let x = cCapacityOptions.xAxis.data[e.currentIndex]; + let y = cCapacityOptions.series.data[e.currentIndex]; cCapacity.setOption({ - - - }) - */ + series: { + markPoint: { + data: [{ + coord: [x, y] + }] + } + } + }); }) cCapacity.on('click', 'series', (e) => { + // Switch to correct calendar in the timeline cCalendar.dispatchAction({ type: 'timelineChange', currentIndex: e.dataIndex diff --git a/etl/src/data/etl_property_capacities.py b/etl/src/data/etl_property_capacities.py index f3bab08..06a527f 100644 --- a/etl/src/data/etl_property_capacities.py +++ b/etl/src/data/etl_property_capacities.py @@ -27,7 +27,6 @@ def property_capacities(id: int): liste = [x for x in dates if x is not None] count_days.append(len(liste)) - print(sum_hor) counts = pl.DataFrame({"count_days" : count_days, "sum" : sum_hor}) result = {"capacities": [], "dates": extractions['created_at'].cast(pl.Datetime).to_list() }