diff --git a/src/modules/employee-list/components/employee-list-table-item.vue b/src/modules/employee-list/components/employee-list-table-item.vue index 745f69d..d7472d0 100644 --- a/src/modules/employee-list/components/employee-list-table-item.vue +++ b/src/modules/employee-list/components/employee-list-table-item.vue @@ -1,4 +1,7 @@ - \ No newline at end of file diff --git a/src/modules/employee-list/components/employee-list-table.vue b/src/modules/employee-list/components/employee-list-table.vue index 6f3cc09..c6b9390 100644 --- a/src/modules/employee-list/components/employee-list-table.vue +++ b/src/modules/employee-list/components/employee-list-table.vue @@ -1,31 +1,21 @@ - @@ -55,7 +55,6 @@ :options="({ indexAxis: $q.screen.lt.md ? 'y' : 'x', plugins: { - title: { display: true, text: t('timesheet_approvals.chart.expenses_title'), diff --git a/src/modules/timesheet-approval/components/details-dialog-chart-hours-worked.vue b/src/modules/timesheet-approval/components/details-dialog-chart-hours-worked.vue index 09d21aa..fa23900 100644 --- a/src/modules/timesheet-approval/components/details-dialog-chart-hours-worked.vue +++ b/src/modules/timesheet-approval/components/details-dialog-chart-hours-worked.vue @@ -2,11 +2,11 @@ setup lang="ts" > - import { ref, computed, onMounted } from 'vue'; + import { ref, onMounted } from 'vue'; import { useI18n } from 'vue-i18n'; import { colors, useQuasar } from 'quasar'; import { Bar } from 'vue-chartjs'; - import { Chart as ChartJS, Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale, type ChartData, type ChartDataset } from 'chart.js'; + import { Chart as ChartJS, Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale, TimeScale, type ChartDataset } from 'chart.js'; import { useTimesheetStore } from 'src/stores/timesheet-store'; import type { TotalHours } from 'src/modules/timesheets/models/timesheet.models'; @@ -19,14 +19,14 @@ const { t } = useI18n(); const $q = useQuasar(); - ChartJS.register(Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale); + ChartJS.register(Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale, TimeScale); ChartJS.defaults.font.family = '"Roboto", sans-serif'; - // ChartJS.defaults.maintainAspectRatio = false; + ChartJS.defaults.maintainAspectRatio = false; ChartJS.defaults.color = $q.dark.isActive ? '#F5F5F5' : '#616161'; const timesheet_store = useTimesheetStore(); - const all_days = computed(() => timesheet_store.timesheets.flatMap(week => week.days)); + const all_days = timesheet_store.timesheets.flatMap(week => week.days); const datasetConfig: ChartConfigHoursWorked[] = [ { @@ -42,36 +42,38 @@ { key: 'emergency', label: t('shared.shift_type.emergency'), - color: getComputedStyle(document.body).getPropertyValue('--q-warning').trim(), + color: colors.getPaletteColor('warning'), }, { key: 'overtime', label: t('shared.shift_type.overtime'), - color: getComputedStyle(document.body).getPropertyValue('--q-negative').trim(), + color: colors.getPaletteColor('negative'), }, ]; - const hours_worked_labels = ref(all_days.value.map(day => day.date.slice(-5,))); + const hours_worked_labels = ref(all_days.map(day => day.date.slice(-5,))); const hours_worked_dataset = ref[]>([]); onMounted(() => { - hours_worked_dataset.value = datasetConfig.map(cfg => ({ - label: cfg.label, - data: all_days.value.map(day => day.daily_hours[cfg.key]), - backgroundColor: cfg.color, - })); + setTimeout(() => { + hours_worked_dataset.value = datasetConfig.map(cfg => ({ + label: cfg.label, + data: all_days.map(day => day.daily_hours[cfg.key]), + backgroundColor: cfg.color, + })); + }, 100); });