Bugfix/fix empty state of proportion chart (#976)

* Fix empty state (chart with two levels)

* Update changelog
This commit is contained in:
Thomas Kaul 2022-05-29 15:38:13 +02:00 committed by GitHub
parent f1e06347d3
commit b9c9443899
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Exposed the environment variable `REDIS_PASSWORD`
### Fixed
- Fixed the empty state of the portfolio proportion chart component (with 2 levels)
### Todo
- Apply data migration (`yarn database:migrate`)

View File

@ -248,6 +248,12 @@ export class PortfolioProportionChartComponent
datasets[0].data[0] = Number.MAX_SAFE_INTEGER;
}
if (datasets[1]?.data?.length === 0 || datasets[1]?.data?.[1] === 0) {
labels = [''];
datasets[1].backgroundColor = [this.colorMap[UNKNOWN_KEY]];
datasets[1].data[1] = Number.MAX_SAFE_INTEGER;
}
const data: ChartConfiguration['data'] = {
datasets,
labels