getPercentage
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Peter (extern) 2021-05-26 14:59:03 +02:00
parent bcfa13de60
commit 880eb26a99

View File

@ -78,7 +78,7 @@ export class LegendComponent implements OnInit,AfterViewInit {
return v;
}
public getLabel(renderer: IRenderer, index: number): number {
public getPercentage(renderer: IRenderer, index: number): number {
let scale = 100 / renderer.band.histogram.entries.reduce((sum, entry) => sum + entry.freqency, 0);
let percent = renderer.band.histogram.entries[index].freqency * scale;
return percent < 0.1 ? null : percent;