Browse Source

Refactoring

pull/6054/head
Thomas Kaul 2 weeks ago
parent
commit
b2e379505c
  1. 3
      libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

3
libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

@ -193,8 +193,6 @@ export class GfPortfolioProportionChartComponent
}); });
} }
// If data is in percent format and total is less than 100%,
// allocate the remaining percentage to UNKNOWN_KEY
if (this.isInPercent) { if (this.isInPercent) {
const totalValueInPercentage = getSum( const totalValueInPercentage = getSum(
Object.values(chartData).map(({ value }) => { Object.values(chartData).map(({ value }) => {
@ -205,6 +203,7 @@ export class GfPortfolioProportionChartComponent
const unknownValueInPercentage = new Big(1).minus(totalValueInPercentage); const unknownValueInPercentage = new Big(1).minus(totalValueInPercentage);
if (unknownValueInPercentage.gt(0)) { if (unknownValueInPercentage.gt(0)) {
// If total is below 100%, allocate the remaining percentage to UNKNOWN_KEY
if (chartData[UNKNOWN_KEY]) { if (chartData[UNKNOWN_KEY]) {
chartData[UNKNOWN_KEY].value = chartData[UNKNOWN_KEY].value.plus( chartData[UNKNOWN_KEY].value = chartData[UNKNOWN_KEY].value.plus(
unknownValueInPercentage unknownValueInPercentage

Loading…
Cancel
Save