diff --git a/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts b/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts index dd50d67c8..c1df83455 100644 --- a/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts +++ b/apps/client/src/app/components/portfolio-proportion-chart/portfolio-proportion-chart.component.ts @@ -167,7 +167,8 @@ export class PortfolioProportionChartComponent // Reuse color item.color = this.colorMap[symbol]; } else { - const color = this.getColorPalette()[index]; + const color = + this.getColorPalette()[index % this.getColorPalette().length]; // Store color for reuse this.colorMap[symbol] = color; diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts index fa24af7ff..812bf44ac 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts @@ -49,6 +49,7 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { public user: User; private unsubscribeSubject = new Subject(); + /** * @constructor */ @@ -148,12 +149,6 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { }; this.positionsArray.push(position); - if (this.symbols[symbol] === undefined) { - this.symbols[symbol] = { name: symbol, value: position.value }; - } else { - this.symbols[symbol].value += position.value; - } - if (position.assetClass !== AssetClass.CASH) { // Prepare analysis data by continents, countries and sectors except for cash @@ -223,6 +218,15 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { : this.portfolioDetails.holdings[symbol].value; } } + + if (position.assetSubClass !== AssetClass.CASH) { + // Prepare analysis data by symbols except for cash + + this.symbols[symbol] = { + name: symbol, + value: aPeriod === 'original' ? position.investment : position.value + }; + } } } diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html index 939bc8fc8..6d16956be 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.html +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.html @@ -19,10 +19,9 @@