From 9a61f841db2135380495c5144eb3e4d6f0cefd36 Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Thu, 9 Jun 2022 15:01:19 +0300 Subject: [PATCH] long texts controlled for donut chart --- app/Abstracts/Report.php | 3 +++ app/Widgets/ExpensesByCategory.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php index 5028c4c44..5ca518bc7 100644 --- a/app/Abstracts/Report.php +++ b/app/Abstracts/Report.php @@ -237,6 +237,9 @@ abstract class Report ->setColors(array_values($colors)) ->setDataset($this->tables[$table_key], 'donut', array_values($values)); + $chart->options['legend']['width'] = 160; + $chart->options['legend']['position'] = 'right'; + return $chart; } diff --git a/app/Widgets/ExpensesByCategory.php b/app/Widgets/ExpensesByCategory.php index 939d2a450..acd16eee0 100644 --- a/app/Widgets/ExpensesByCategory.php +++ b/app/Widgets/ExpensesByCategory.php @@ -27,7 +27,7 @@ class ExpensesByCategory extends Widget $chart = $this->getDonutChart(trans_choice('general.expenses', 2), '100%', 300, 6); - $chart->options['legend']['width'] = 200; + $chart->options['legend']['width'] = 220; $chart->options['legend']['position'] = 'right'; return $this->view('widgets.donut_chart', [