Browse Source
Bugfix/fix algebraic sign in label of treemap chart (#4030)
* Fix algebraic sign
* Update changelog
pull/4033/head
Thomas Kaul
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
13 additions and
3 deletions
-
CHANGELOG.md
-
libs/ui/src/lib/treemap-chart/treemap-chart.component.ts
|
|
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed an issue with the algebraic sign in the chart of the holdings tab on the home page (experimental) |
|
|
|
- Improved the exception handling in the user authorization service |
|
|
|
- Disabled the caching of the benchmarks in the markets overview if sharing the _Fear & Greed Index_ (market mood) is enabled |
|
|
|
|
|
|
|
|
|
@ -261,12 +261,21 @@ export class GfTreemapChartComponent |
|
|
|
display: true, |
|
|
|
font: [{ size: 16 }, { lineHeight: 1.5, size: 14 }], |
|
|
|
formatter: (ctx) => { |
|
|
|
const netPerformancePercentWithCurrencyEffect = |
|
|
|
ctx.raw._data.netPerformancePercentWithCurrencyEffect; |
|
|
|
// Round to 4 decimal places
|
|
|
|
let netPerformancePercentWithCurrencyEffect = |
|
|
|
Math.round( |
|
|
|
ctx.raw._data.netPerformancePercentWithCurrencyEffect * 10000 |
|
|
|
) / 10000; |
|
|
|
|
|
|
|
if (Math.abs(netPerformancePercentWithCurrencyEffect) === 0) { |
|
|
|
netPerformancePercentWithCurrencyEffect = Math.abs( |
|
|
|
netPerformancePercentWithCurrencyEffect |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
return [ |
|
|
|
ctx.raw._data.symbol, |
|
|
|
`${netPerformancePercentWithCurrencyEffect > 0 ? '+' : ''}${(ctx.raw._data.netPerformancePercentWithCurrencyEffect * 100).toFixed(2)}%` |
|
|
|
`${netPerformancePercentWithCurrencyEffect > 0 ? '+' : ''}${(netPerformancePercentWithCurrencyEffect * 100).toFixed(2)}%` |
|
|
|
]; |
|
|
|
}, |
|
|
|
hoverColor: undefined, |
|
|
|