From 696d5d9882e432517b6f77d622ebe661403b4d31 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 9 Oct 2026 10:43:55 +0200 Subject: [PATCH] Bugfix/missing first data point in portfolio evolution chart (#8089) * Fix missing first data point in portfolio evolution chart * Update changelog --- CHANGELOG.md | 4 ++ .../analysis/analysis-page.component.ts | 48 ++++++++----------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbcb107461..2682a7b753 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved the language localization for Spanish (`es`) +### Fixed + +- Fixed the missing first data point in the portfolio evolution chart on the analysis page + ## 3.81.0 - 2026-10-07 ### Changed 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 5629965006..62debb78a5 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 @@ -329,36 +329,30 @@ export class GfAnalysisPageComponent implements OnInit { this.performanceDataItems = []; this.performanceDataItemsInPercentage = []; - for (const [ - index, - { - date, - dividendInPercentageWithCurrencyEffect, - netPerformanceInPercentageWithCurrencyEffect, - totalInvestmentValueWithCurrencyEffect, - valueInPercentage, - valueWithCurrencyEffect + for (const { + date, + dividendInPercentageWithCurrencyEffect, + netPerformanceInPercentageWithCurrencyEffect, + totalInvestmentValueWithCurrencyEffect, + valueInPercentage, + valueWithCurrencyEffect + } of chart ?? []) { + if (totalInvestmentValueWithCurrencyEffect !== undefined) { + this.investments.push({ + date, + investment: totalInvestmentValueWithCurrencyEffect + }); } - ] of (chart ?? []).entries()) { - // Ignore first item where value is 0 - if (index > 0 || this.user?.settings?.dateRange === 'max') { - if (totalInvestmentValueWithCurrencyEffect !== undefined) { - this.investments.push({ - date, - investment: totalInvestmentValueWithCurrencyEffect - }); - } - const value = isNumber(valueWithCurrencyEffect) - ? valueWithCurrencyEffect - : valueInPercentage; + const value = isNumber(valueWithCurrencyEffect) + ? valueWithCurrencyEffect + : valueInPercentage; - if (isNumber(value)) { - this.performanceDataItems.push({ - date, - value - }); - } + if (isNumber(value)) { + this.performanceDataItems.push({ + date, + value + }); } if (isNumber(netPerformanceInPercentageWithCurrencyEffect)) {