mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-22 03:56:42 +00:00
Chart no longer as a line chart.
This commit is contained in:
@@ -102,7 +102,7 @@ class AccountController extends Controller
|
||||
$tempData = [];
|
||||
|
||||
// grab all accounts and names
|
||||
$accounts = $this->accountRepository->getAccountsByType([AccountType::EXPENSE]);
|
||||
$accounts = $this->accountRepository->getAccountsByType([AccountTypeEnum::EXPENSE->value]);
|
||||
$accountNames = $this->extractNames($accounts);
|
||||
|
||||
// grab all balances
|
||||
@@ -133,6 +133,14 @@ class AccountController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
// recreate currencies, but on ID instead of code.
|
||||
$newCurrencies = [];
|
||||
foreach($currencies as $currency) {
|
||||
$newCurrencies[$currency->id] = $currency;
|
||||
}
|
||||
$currencies = $newCurrencies;
|
||||
|
||||
|
||||
|
||||
// sort temp array by amount.
|
||||
$amounts = array_column($tempData, 'diff_float');
|
||||
@@ -159,7 +167,7 @@ class AccountController extends Controller
|
||||
foreach ($tempData as $entry) {
|
||||
$currencyId = $entry['currency_id'];
|
||||
$name = $entry['name'];
|
||||
$chartData[$currencyId]['entries'][$name] = $entry['difference'];
|
||||
$chartData[$currencyId]['entries'][$name] = (float) $entry['difference'];
|
||||
}
|
||||
|
||||
$data = $this->generator->multiSet($chartData);
|
||||
@@ -511,6 +519,8 @@ class AccountController extends Controller
|
||||
$startBalances = app('steam')->finalAccountsBalance($accounts, $start);
|
||||
$endBalances = app('steam')->finalAccountsBalance($accounts, $end);
|
||||
|
||||
|
||||
|
||||
// loop the end balances. This is an array for each account ($expenses)
|
||||
foreach ($endBalances as $accountId => $expenses) {
|
||||
$accountId = (int) $accountId;
|
||||
@@ -537,6 +547,13 @@ class AccountController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// recreate currencies, but on ID instead of code.
|
||||
$newCurrencies = [];
|
||||
foreach($currencies as $currency) {
|
||||
$newCurrencies[$currency->id] = $currency;
|
||||
}
|
||||
$currencies = $newCurrencies;
|
||||
|
||||
// sort temp array by amount.
|
||||
$amounts = array_column($tempData, 'diff_float');
|
||||
array_multisort($amounts, SORT_ASC, $tempData);
|
||||
|
Reference in New Issue
Block a user