Browse Source

Refactor input to isInPercentage

pull/6691/head
Thomas Kaul 2 months ago
parent
commit
83f58176cf
  1. 6
      libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

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

@ -74,7 +74,7 @@ export class GfPortfolioProportionChartComponent
value: number;
};
} = {};
@Input() isInPercent = false;
@Input() isInPercentage = false;
@Input() keys: string[] = [];
@Input() locale = getLocale();
@Input() maxItems?: number;
@ -198,7 +198,7 @@ export class GfPortfolioProportionChartComponent
});
}
if (this.isInPercent) {
if (this.isInPercentage) {
const totalValueInPercentage = getSum(
Object.values(chartData).map(({ value }) => {
return value;
@ -465,7 +465,7 @@ export class GfPortfolioProportionChartComponent
if ((context.raw as number) === Number.MAX_SAFE_INTEGER) {
return $localize`No data available`;
} else if (this.isInPercent) {
} else if (this.isInPercentage) {
return [`${name ?? symbol}`, `${percentage.toFixed(2)}%`];
} else {
const value = context.raw as number;

Loading…
Cancel
Save