diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c66c9c07..c200f9d62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Added + +- Extended the analysis page to include the total amount, change and performance with currency effects + ### Changed - Deprecated `firstBuyDate` in favor of `dateOfFirstActivity` in the endpoint `GET api/v1/portfolio/holding/:dataSource/:symbol` 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 ec872c770..5cd24777c 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 @@ -2,6 +2,7 @@ import { GfBenchmarkComparatorComponent } from '@ghostfolio/client/components/be import { GfInvestmentChartComponent } from '@ghostfolio/client/components/investment-chart/investment-chart.component'; import { ImpersonationStorageService } from '@ghostfolio/client/services/impersonation-storage.service'; import { UserService } from '@ghostfolio/client/services/user/user.service'; +import { NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; import { HistoricalDataItem, InvestmentItem, @@ -94,6 +95,7 @@ export class GfAnalysisPageComponent implements OnDestroy, OnInit { public performanceDataItems: HistoricalDataItem[]; public performanceDataItemsInPercentage: HistoricalDataItem[]; public portfolioEvolutionDataLabel = $localize`Investment`; + public precision = 2; public streaks: PortfolioInvestmentsResponse['streaks']; public top3: PortfolioPosition[]; public unitCurrentStreak: string; @@ -317,12 +319,21 @@ export class GfAnalysisPageComponent implements OnDestroy, OnInit { : valueInPercentage }); } + this.performanceDataItemsInPercentage.push({ date, value: netPerformanceInPercentageWithCurrencyEffect }); } + if ( + this.deviceType === 'mobile' && + this.performance.currentValueInBaseCurrency >= + NUMERICAL_PRECISION_THRESHOLD_6_FIGURES + ) { + this.precision = 0; + } + this.isLoadingInvestmentChart = false; this.updateBenchmarkDataItems(); 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 150caa7d8..b4170c2c5 100644 --- a/apps/client/src/app/pages/portfolio/analysis/analysis-page.html +++ b/apps/client/src/app/pages/portfolio/analysis/analysis-page.html @@ -74,6 +74,70 @@ } + +
+
+ + + Total amount + + +
+
+ + + Change with currency effect + + +
+
+ + + Performance with currency effect + + +
+
+