From 5b8733a6e68aca64407c6bff6b81a8a308c815cd Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 13 Jan 2024 13:34:11 +0100 Subject: [PATCH] Break down performance into asset and currency --- .../analysis/analysis-page.component.ts | 5 +- .../portfolio/analysis/analysis-page.html | 102 ++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts index f3072d5bc..0ed7c4444 100644 --- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts +++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts @@ -11,6 +11,7 @@ import { Filter, HistoricalDataItem, PortfolioInvestments, + PortfolioPerformance, Position, User } from '@ghostfolio/common/interfaces'; @@ -54,6 +55,7 @@ export class AnalysisPageComponent implements OnDestroy, OnInit { { label: $localize`Monthly`, value: 'month' }, { label: $localize`Yearly`, value: 'year' } ]; + public performance: PortfolioPerformance; public performanceDataItems: HistoricalDataItem[]; public performanceDataItemsInPercentage: HistoricalDataItem[]; public placeholder = ''; @@ -326,11 +328,12 @@ export class AnalysisPageComponent implements OnDestroy, OnInit { range: this.user?.settings?.dateRange }) .pipe(takeUntil(this.unsubscribeSubject)) - .subscribe(({ chart, firstOrderDate }) => { + .subscribe(({ chart, firstOrderDate, performance }) => { this.firstOrderDate = firstOrderDate ?? new Date(); this.daysInMarket = differenceInDays(new Date(), firstOrderDate); this.investments = []; + this.performance = performance; this.performanceDataItems = []; this.performanceDataItemsInPercentage = []; diff --git a/apps/client/src/app/pages/portfolio/analysis/analysis-page.html b/apps/client/src/app/pages/portfolio/analysis/analysis-page.html index ae14d205a..0d69c7b05 100644 --- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.html +++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.html @@ -34,6 +34,108 @@ + @if (user?.settings?.isExperimentalFeatures) { +
+
+ + +
+
+ Absolute Asset Performance +
+
+ +
+
+
+
+ Asset Performance +
+
+ +
+
+
+
+ Absolute Currency Performance +
+
+ +
+
+
+
+ Currency Performance +
+
+ +
+
+

+
+
+ Absolute Net Performance +
+
+ +
+
+
+
+ Net Performance +
+
+ +
+
+
+
+
+
+ } +