fixed formatting of card

This commit is contained in:
Ralf Bauer 2023-06-28 18:52:23 +02:00
parent 4b88413b4f
commit bf7be21c13
2 changed files with 17 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<template>
<div class="card" v-if="dataLoaded">
<div class="card row" v-if="dataLoaded">
<GChart type="ColumnChart" :data="chartData" :options="chartOptions" />
</div>
</template>
@ -19,7 +19,7 @@ const options_col = {
height: '80%'
},
bar: {
groupWidth: '100%'
groupWidth: '90%'
},
legend: {
position: 'none'

View File

@ -1,5 +1,5 @@
<template>
<div class="card" v-if="dataLoaded">
<div class="card row" v-if="dataLoaded">
<GChart type="Calendar" :data="chartData" :options="chartOptions" :settings="{ packages: ['calendar'] }" />
</div>
</template>
@ -33,6 +33,7 @@ export default defineComponent({
},
created() {
this.getInitialData();
this.startautorefresh();
},
methods: {
getInitialData() {
@ -52,7 +53,19 @@ export default defineComponent({
this.dataLoaded = true;
}
})
}
},
callEveryHour() {
this.getInitialData();
setInterval(this.getInitialData, 1000 * 60 * 60); // refresh every hour
},
startautorefresh() {
var nextDate = new Date();
nextDate.setHours(nextDate.getHours() + 1);
nextDate.setMinutes(0);
nextDate.setSeconds(5);
var difference: number = nextDate.valueOf() - Date.now();
setTimeout(this.callEveryHour, difference);
},
}
});
</script>