|
|
|
@ -314,23 +314,18 @@ export class GfTreemapChartComponent |
|
|
|
formatter: (context: GfTreemapScriptableContext) => { |
|
|
|
const raw = context.raw as GfTreemapDataPoint; |
|
|
|
|
|
|
|
let netPerformancePercentWithCurrencyEffect = round( |
|
|
|
raw._data.netPerformancePercentWithCurrencyEffect, |
|
|
|
4 |
|
|
|
); |
|
|
|
|
|
|
|
if (Math.abs(netPerformancePercentWithCurrencyEffect) === 0) { |
|
|
|
netPerformancePercentWithCurrencyEffect = Math.abs( |
|
|
|
netPerformancePercentWithCurrencyEffect |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
const name = raw._data.assetProfile.name; |
|
|
|
const symbol = raw._data.assetProfile.symbol; |
|
|
|
|
|
|
|
return [ |
|
|
|
isUUID(symbol) ? (name ?? symbol) : symbol, |
|
|
|
`${netPerformancePercentWithCurrencyEffect > 0 ? '+' : ''}${(netPerformancePercentWithCurrencyEffect * 100).toFixed(2)}%` |
|
|
|
`${( |
|
|
|
raw._data.netPerformancePercentWithCurrencyEffect * 100 |
|
|
|
).toLocaleString(this.locale(), { |
|
|
|
maximumFractionDigits: 2, |
|
|
|
minimumFractionDigits: 2, |
|
|
|
signDisplay: 'exceptZero' |
|
|
|
})}%` |
|
|
|
]; |
|
|
|
}, |
|
|
|
hoverColor: undefined, |
|
|
|
@ -402,13 +397,21 @@ export class GfTreemapChartComponent |
|
|
|
label: (context: TooltipItem<'treemap'>) => { |
|
|
|
const raw = context.raw as GfTreemapDataPoint; |
|
|
|
|
|
|
|
const allocationInPercentage = `${(raw._data.allocationInPercentage * 100).toFixed(2)}%`; |
|
|
|
const allocationInPercentage = `${( |
|
|
|
raw._data.allocationInPercentage * 100 |
|
|
|
).toLocaleString(this.locale(), { |
|
|
|
maximumFractionDigits: 2, |
|
|
|
minimumFractionDigits: 2 |
|
|
|
})}%`;
|
|
|
|
const name = getHoldingName(raw._data.assetProfile); |
|
|
|
|
|
|
|
const sign = |
|
|
|
raw._data.netPerformancePercentWithCurrencyEffect > 0 ? '+' : ''; |
|
|
|
|
|
|
|
const netPerformanceInPercentageWithSign = `${sign}${(raw._data.netPerformancePercentWithCurrencyEffect * 100).toFixed(2)}%`; |
|
|
|
const netPerformanceInPercentageWithSign = `${( |
|
|
|
raw._data.netPerformancePercentWithCurrencyEffect * 100 |
|
|
|
).toLocaleString(this.locale(), { |
|
|
|
maximumFractionDigits: 2, |
|
|
|
minimumFractionDigits: 2, |
|
|
|
signDisplay: 'exceptZero' |
|
|
|
})}%`;
|
|
|
|
|
|
|
|
if (raw._data.valueInBaseCurrency !== null) { |
|
|
|
const value = raw._data.valueInBaseCurrency; |
|
|
|
@ -421,11 +424,12 @@ export class GfTreemapChartComponent |
|
|
|
})} ${this.baseCurrency()}`,
|
|
|
|
'', |
|
|
|
$localize`Change` + ' (' + $localize`Performance` + ')', |
|
|
|
`${sign}${raw._data.netPerformanceWithCurrencyEffect.toLocaleString( |
|
|
|
`${raw._data.netPerformanceWithCurrencyEffect.toLocaleString( |
|
|
|
this.locale(), |
|
|
|
{ |
|
|
|
maximumFractionDigits: 2, |
|
|
|
minimumFractionDigits: 2 |
|
|
|
minimumFractionDigits: 2, |
|
|
|
signDisplay: 'exceptZero' |
|
|
|
} |
|
|
|
)} ${this.baseCurrency()} (${netPerformanceInPercentageWithSign})` |
|
|
|
]; |
|
|
|
|