|
|
@ -186,18 +186,6 @@ export class GfTreemapChartComponent |
|
|
return dataset[activeElement.index]; |
|
|
return dataset[activeElement.index]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private getRoundedValue({ |
|
|
|
|
|
precision, |
|
|
|
|
|
value |
|
|
|
|
|
}: { |
|
|
|
|
|
precision: number; |
|
|
|
|
|
value: number; |
|
|
|
|
|
}) { |
|
|
|
|
|
const roundedValue = round(value, precision); |
|
|
|
|
|
|
|
|
|
|
|
return roundedValue === 0 ? 0 : roundedValue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private initialize() { |
|
|
private initialize() { |
|
|
const holdings = this.holdings(); |
|
|
const holdings = this.holdings(); |
|
|
|
|
|
|
|
|
@ -326,18 +314,18 @@ export class GfTreemapChartComponent |
|
|
formatter: (context: GfTreemapScriptableContext) => { |
|
|
formatter: (context: GfTreemapScriptableContext) => { |
|
|
const raw = context.raw as GfTreemapDataPoint; |
|
|
const raw = context.raw as GfTreemapDataPoint; |
|
|
|
|
|
|
|
|
const netPerformancePercentWithCurrencyEffect = |
|
|
|
|
|
this.getRoundedValue({ |
|
|
|
|
|
precision: 4, |
|
|
|
|
|
value: raw._data.netPerformancePercentWithCurrencyEffect |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const name = raw._data.assetProfile.name; |
|
|
const name = raw._data.assetProfile.name; |
|
|
const symbol = raw._data.assetProfile.symbol; |
|
|
const symbol = raw._data.assetProfile.symbol; |
|
|
|
|
|
|
|
|
return [ |
|
|
return [ |
|
|
isUUID(symbol) ? (name ?? symbol) : symbol, |
|
|
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, |
|
|
hoverColor: undefined, |
|
|
@ -412,14 +400,13 @@ export class GfTreemapChartComponent |
|
|
const allocationInPercentage = `${(raw._data.allocationInPercentage * 100).toFixed(2)}%`; |
|
|
const allocationInPercentage = `${(raw._data.allocationInPercentage * 100).toFixed(2)}%`; |
|
|
const name = getHoldingName(raw._data.assetProfile); |
|
|
const name = getHoldingName(raw._data.assetProfile); |
|
|
|
|
|
|
|
|
const netPerformancePercentWithCurrencyEffect = this.getRoundedValue({ |
|
|
const netPerformanceInPercentageWithSign = `${( |
|
|
precision: 4, |
|
|
raw._data.netPerformancePercentWithCurrencyEffect * 100 |
|
|
value: raw._data.netPerformancePercentWithCurrencyEffect |
|
|
).toLocaleString(this.locale(), { |
|
|
}); |
|
|
maximumFractionDigits: 2, |
|
|
|
|
|
minimumFractionDigits: 2, |
|
|
const sign = netPerformancePercentWithCurrencyEffect > 0 ? '+' : ''; |
|
|
signDisplay: 'exceptZero' |
|
|
|
|
|
})}%`;
|
|
|
const netPerformanceInPercentageWithSign = `${sign}${(netPerformancePercentWithCurrencyEffect * 100).toFixed(2)}%`; |
|
|
|
|
|
|
|
|
|
|
|
if (raw._data.valueInBaseCurrency !== null) { |
|
|
if (raw._data.valueInBaseCurrency !== null) { |
|
|
const value = raw._data.valueInBaseCurrency; |
|
|
const value = raw._data.valueInBaseCurrency; |
|
|
|