From 9e1413c15f3c02a1a1a54f0c4f709aa88dbbe62a Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Thu, 12 Sep 2024 15:12:50 +0200 Subject: [PATCH] unify and fix chart styles in dashboard and reporting view, fixes ST-356 --- .../Common/Reporting/ReportingPieChart.vue | 15 +++-- .../Dashboard/ProjectsChartCard.vue | 56 +++++-------------- resources/js/Layouts/AppLayout.vue | 2 +- resources/js/Pages/Reporting.vue | 7 ++- 4 files changed, 29 insertions(+), 51 deletions(-) diff --git a/resources/js/Components/Common/Reporting/ReportingPieChart.vue b/resources/js/Components/Common/Reporting/ReportingPieChart.vue index 51d17754..f6c08000 100644 --- a/resources/js/Components/Common/Reporting/ReportingPieChart.vue +++ b/resources/js/Components/Common/Reporting/ReportingPieChart.vue @@ -40,11 +40,11 @@ const groupChartData = computed(() => { const name = getNameForReportingRowEntry(entry.key, props.type); let color = getRandomColorWithSeed(entry.key ?? 'none'); if (name && props.type && emptyPlaceholder[props.type] === name) { - color = '#CCC'; + color = '#CCCCCC'; } else if (props.type === 'project') { color = projects.find((project) => project.id === entry.key) - ?.color ?? '#CCC'; + ?.color ?? '#CCCCCC'; } return { value: entry.seconds, @@ -61,7 +61,12 @@ const seriesData = computed(() => { ...el, ...{ itemStyle: { - color: el.color, + color: `${el.color}BB`, + }, + emphasis: { + itemStyle: { + color: `${el.color}`, + }, }, }, }; @@ -88,7 +93,7 @@ const option = ref({ }, data: seriesData, radius: ['30%', '60%'], - top: '-50%', + top: '-45%', type: 'pie', }, ], @@ -97,7 +102,7 @@ const option = ref({ diff --git a/resources/js/Components/Dashboard/ProjectsChartCard.vue b/resources/js/Components/Dashboard/ProjectsChartCard.vue index 26d1f7cc..d842d398 100644 --- a/resources/js/Components/Dashboard/ProjectsChartCard.vue +++ b/resources/js/Components/Dashboard/ProjectsChartCard.vue @@ -1,7 +1,6 @@ - - diff --git a/resources/js/Layouts/AppLayout.vue b/resources/js/Layouts/AppLayout.vue index 8bd1838b..47d815d1 100644 --- a/resources/js/Layouts/AppLayout.vue +++ b/resources/js/Layouts/AppLayout.vue @@ -177,7 +177,7 @@ const page = usePage<{ href="/billing"> diff --git a/resources/js/Pages/Reporting.vue b/resources/js/Pages/Reporting.vue index 98fa2961..420a8ccf 100644 --- a/resources/js/Pages/Reporting.vue +++ b/resources/js/Pages/Reporting.vue @@ -146,7 +146,10 @@ async function createTag(tag: string) {