diff --git a/resources/assets/v2/api/v2/chart/account/dashboard.js b/resources/assets/v2/api/v2/chart/account/dashboard.js index f14aeff886..521bf7405b 100644 --- a/resources/assets/v2/api/v2/chart/account/dashboard.js +++ b/resources/assets/v2/api/v2/chart/account/dashboard.js @@ -27,4 +27,10 @@ export default class Dashboard { let endStr = format(end, 'y-MM-dd'); return api.get('/api/v2/chart/account/dashboard', {params: {start: startStr, end: endStr}}); } + + expense(start, end) { + let startStr = format(start, 'y-MM-dd'); + let endStr = format(end, 'y-MM-dd'); + return api.get('/api/v2/chart/account/expense-dashboard', {params: {start: startStr, end: endStr}}); + } } diff --git a/resources/assets/v2/pages/dashboard/accounts.js b/resources/assets/v2/pages/dashboard/accounts.js index 05a93056e0..923ef06f03 100644 --- a/resources/assets/v2/pages/dashboard/accounts.js +++ b/resources/assets/v2/pages/dashboard/accounts.js @@ -209,12 +209,14 @@ export default () => ({ init() { Promise.all([getVariable('viewRange', '1M'), getVariable('autoConversion', false),]).then((values) => { this.autoConversion = values[1]; - // console.log(values[1]); + // main dashboard chart: this.loadChart(); this.loadAccounts(); }); window.store.observe('end', () => { this.chartData = null; + this.expenseAccountChart = null; + // main dashboard chart: this.loadChart(); this.loadAccounts(); }); diff --git a/resources/assets/v2/pages/dashboard/categories.js b/resources/assets/v2/pages/dashboard/categories.js index e97d0f967e..25d374e5a2 100644 --- a/resources/assets/v2/pages/dashboard/categories.js +++ b/resources/assets/v2/pages/dashboard/categories.js @@ -55,7 +55,23 @@ export default () => ({ xaxis: { categories: [], }, - yaxis: {}, + yaxis: { + labels: { + formatter: function (value, index) { + if (undefined === value) { + return value; + } + if (undefined === index) { + return value; + } + if (typeof index === 'object') { + index = index.dataPointIndex; // this is the "category name + currency" index + } + let currencyCode = window.budgetCurrencies[index] ?? 'EUR'; + return formatMoney(value, currencyCode); + } + } + }, fill: { opacity: 1 }, diff --git a/resources/views/v2/index.blade.php b/resources/views/v2/index.blade.php index f18d3db325..b47d7dcb1e 100644 --- a/resources/views/v2/index.blade.php +++ b/resources/views/v2/index.blade.php @@ -13,31 +13,30 @@
-
-
+
-

-

@@ -51,7 +50,7 @@ title="{{ __('firefly.go_to_budgets') }}">{{ __('firefly.budgetsAndSpending') }}
-
+
@@ -66,7 +65,7 @@ title="{{ __('firefly.yourAccounts') }}">{{ __('firefly.categories') }}
-
+
@@ -145,10 +144,12 @@ @@ -177,7 +178,7 @@