show donuts prorated
This commit is contained in:
parent
20937cda5f
commit
b171451a23
@ -166,6 +166,13 @@ class Dashboard extends Controller
|
||||
|
||||
private function getDonuts()
|
||||
{
|
||||
// Show donut prorated if there is no income
|
||||
if (array_sum($this->income_donut['values']) == 0) {
|
||||
foreach ($this->income_donut['values'] as $key => $value) {
|
||||
$this->income_donut['values'][$key] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$donut_incomes = Charts::create('donut', 'chartjs')
|
||||
->colors($this->income_donut['colors'])
|
||||
->labels($this->income_donut['labels'])
|
||||
@ -174,6 +181,13 @@ class Dashboard extends Controller
|
||||
->credits(false)
|
||||
->view('vendor.consoletvs.charts.chartjs.donut');
|
||||
|
||||
// Show donut prorated if there is no expense
|
||||
if (array_sum($this->expense_donut['values']) == 0) {
|
||||
foreach ($this->expense_donut['values'] as $key => $value) {
|
||||
$this->expense_donut['values'][$key] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$donut_expenses = Charts::create('donut', 'chartjs')
|
||||
->colors($this->expense_donut['colors'])
|
||||
->labels($this->expense_donut['labels'])
|
||||
|
@ -94,7 +94,7 @@ return [
|
||||
|
||||
'chartjs' => [
|
||||
'scripts' => [
|
||||
url('public/js/chartjs//Chart.min.js'),
|
||||
env('APP_URL') . '/public/js/chartjs/Chart.min.js',
|
||||
],
|
||||
],
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user