Feature/ignore first item in portfolio evolution chart (#1816)
* Ignore first item in portfolio evolution chart * Update changelog
This commit is contained in:
parent
17b8c41673
commit
9bef2e960c
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Improved the portfolio evolution chart (ignore first item)
|
||||||
|
|
||||||
## 1.249.0 - 2023-03-27
|
## 1.249.0 - 2023-03-27
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -308,18 +308,24 @@ export class AnalysisPageComponent implements OnDestroy, OnInit {
|
|||||||
this.performanceDataItems = [];
|
this.performanceDataItems = [];
|
||||||
this.performanceDataItemsInPercentage = [];
|
this.performanceDataItemsInPercentage = [];
|
||||||
|
|
||||||
for (const {
|
for (const [
|
||||||
date,
|
index,
|
||||||
netPerformanceInPercentage,
|
{
|
||||||
totalInvestment,
|
|
||||||
value,
|
|
||||||
valueInPercentage
|
|
||||||
} of chart) {
|
|
||||||
this.investments.push({ date, investment: totalInvestment });
|
|
||||||
this.performanceDataItems.push({
|
|
||||||
date,
|
date,
|
||||||
value: isNumber(value) ? value : valueInPercentage
|
netPerformanceInPercentage,
|
||||||
});
|
totalInvestment,
|
||||||
|
value,
|
||||||
|
valueInPercentage
|
||||||
|
}
|
||||||
|
] of chart.entries()) {
|
||||||
|
if (index > 0 || this.user?.settings?.dateRange === 'max') {
|
||||||
|
// Ignore first item where value is 0
|
||||||
|
this.investments.push({ date, investment: totalInvestment });
|
||||||
|
this.performanceDataItems.push({
|
||||||
|
date,
|
||||||
|
value: isNumber(value) ? value : valueInPercentage
|
||||||
|
});
|
||||||
|
}
|
||||||
this.performanceDataItemsInPercentage.push({
|
this.performanceDataItemsInPercentage.push({
|
||||||
date,
|
date,
|
||||||
value: netPerformanceInPercentage
|
value: netPerformanceInPercentage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user