From e740d2ef7b79dea615a4b35960172c1ef013ce19 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 10 Oct 2026 12:50:48 +0200 Subject: [PATCH] Add performance timeline --- .../src/app/portfolio/portfolio.controller.ts | 40 +++++++++---------- .../analysis/analysis-page.component.ts | 6 ++- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index 6f3d0df202..72468f1d6e 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -4,7 +4,8 @@ import { Impersonation } from '@ghostfolio/api/decorators/impersonation.decorato import { RequiresScope } from '@ghostfolio/api/decorators/requires-scope.decorator'; import { hasNotDefinedValuesInObject, - nullifyValuesInObject + nullifyValuesInObject, + nullifyValuesInObjects } from '@ghostfolio/api/helper/object.helper'; import { convertValuesToPercentages } from '@ghostfolio/api/helper/portfolio.helper'; import { PerformanceLoggingInterceptor } from '@ghostfolio/api/interceptors/performance-logging/performance-logging.interceptor'; @@ -583,32 +584,27 @@ export class PortfolioController { this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION') && this.request.user.subscription?.type === SubscriptionType.Basic ) { - performanceInformation.chart = performanceInformation.chart.map( - (item) => { - return nullifyValuesInObject(item, [ - 'dividendInBaseCurrency', - 'totalInvestment', - 'value' - ]); - } + performanceInformation.chart = nullifyValuesInObjects( + performanceInformation.chart, + [ + 'dividendInBaseCurrency', + 'totalInvestment', + 'value', + ...(groupBy === 'year' + ? [ + 'investmentValueWithCurrencyEffect', + 'netPerformance', + 'netPerformanceInPercentage', + 'netPerformanceInPercentageWithCurrencyEffect', + 'netPerformanceWithCurrencyEffect' + ] + : []) + ] ); performanceInformation.performance = nullifyValuesInObject( performanceInformation.performance, ['dividendInBaseCurrency', 'netPerformance'] ); - - if (groupBy === 'year') { - performanceInformation.chart = performanceInformation.chart.map( - (item) => { - return nullifyValuesInObject(item, [ - 'netPerformance', - 'netPerformanceInPercentage', - 'netPerformanceInPercentageWithCurrencyEffect', - 'netPerformanceWithCurrencyEffect' - ]); - } - ); - } } return performanceInformation; 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 1d532901ec..26e52678c7 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 @@ -5,6 +5,7 @@ import { DEFAULT_DATE_RANGE, NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; +import { SubscriptionType } from '@ghostfolio/common/enums'; import { canOpenHoldingDetail } from '@ghostfolio/common/helper'; import { InvestmentItem, @@ -454,7 +455,10 @@ export class GfAnalysisPageComponent implements OnInit { this.fetchDividendsAndInvestments(); - if (this.user?.settings?.isExperimentalFeatures) { + if ( + this.user?.settings?.isExperimentalFeatures && + this.user?.subscription?.type !== SubscriptionType.Basic + ) { this.fetchPerformanceByYear(); }