Browse Source

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

* Fix empty state (chart with two levels)

* Update changelog
pull/977/head
Thomas Kaul 2 years ago
committed by GitHub
parent
commit
b9c9443899
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      CHANGELOG.md
  2. 6
      libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

4
CHANGELOG.md

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

6
libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

@ -248,6 +248,12 @@ export class PortfolioProportionChartComponent
datasets[0].data[0] = Number.MAX_SAFE_INTEGER; 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'] = { const data: ChartConfiguration['data'] = {
datasets, datasets,
labels labels

Loading…
Cancel
Save