diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 16ee885..52d5069 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -74,10 +74,12 @@ export class HomeComponent implements OnInit { countSamples(data: any) { this.keys.map(key => key.count = 0); for (var i = 0; i < data.length; i++) { - this.keys.forEach(key => { + this.keys.every(key => { if (key.id === data[i].material.group) { - key.count += 1; + key.count++; + return false; } + return true; }); } this.updateGraph();