fixed chart legend labels
This commit is contained in:
parent
d53b3b9952
commit
2b3638a97d
@ -38,7 +38,7 @@
|
||||
[radius]="80"
|
||||
[strokeWidth]="15"
|
||||
[subtitle]="'dossier-states-listing.chart.dossier-states' | translate"
|
||||
[totalType]="'count'"
|
||||
[totalType]="'simpleLabel'"
|
||||
></redaction-simple-doughnut-chart>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -23,7 +23,7 @@ export class SimpleDoughnutChartComponent implements OnChanges, OnInit {
|
||||
@Input() radius = 85;
|
||||
@Input() strokeWidth = 20;
|
||||
@Input() direction: 'row' | 'column' = 'column';
|
||||
@Input() totalType: 'sum' | 'count' = 'sum';
|
||||
@Input() totalType: 'sum' | 'count' | 'simpleLabel' = 'sum';
|
||||
@Input() counterText: string;
|
||||
@Input() filterKey = 'statusFilters';
|
||||
filtersEnabled: boolean;
|
||||
@ -51,7 +51,7 @@ export class SimpleDoughnutChartComponent implements OnChanges, OnInit {
|
||||
}
|
||||
|
||||
get displayedDataTotal() {
|
||||
return this.totalType === 'sum' ? this.dataTotal : this.config.length;
|
||||
return this.totalType === 'count' ? this.config.length : this.dataTotal;
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@ -96,7 +96,11 @@ export class SimpleDoughnutChartComponent implements OnChanges, OnInit {
|
||||
}
|
||||
|
||||
getLabel({ label, value }: DoughnutChartConfig): string {
|
||||
return this.totalType === 'sum' ? `${value} ${label}` : `${label} (${value} ${this.counterText})`;
|
||||
return this.totalType === 'simpleLabel'
|
||||
? `${label}`
|
||||
: this.totalType === 'sum'
|
||||
? `${value} ${label}`
|
||||
: `${label} (${value} ${this.counterText})`;
|
||||
}
|
||||
|
||||
selectValue(key: string): void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user