Merge pull request #52 from Pear-Trading/finn/sectorColours

added varying colors based on sector
This commit is contained in:
Finn 2017-12-20 13:45:22 +00:00 committed by GitHub
commit 762da58c3d
2 changed files with 25 additions and 1 deletions

View file

@ -85,7 +85,7 @@
<ul class="icons-list">
<!-- New loop -->
<li *ngFor="let sector of sectorLetters | slice:0:sectorLimit; let i=index">
<i [ngClass]="sectorIcons [sector] || 'icon-question'" class="bg-primary"></i>
<i [ngClass]="[sectorIcons [sector] || 'icon-question', sectorClasses [sector] || 'bg-info']"></i>
<div class="desc">
<div class="title">{{ sectorNames [sector] || 'N/A' }}</div>
</div>

View file

@ -78,6 +78,30 @@ export class DashboardCustomerComponent implements OnInit {
U: 'icon-globe',
}
sectorClasses = {
A: 'bg-primary',
B: 'bg-success',
C: 'bg-danger',
D: 'bg-warning',
E: 'bg-info',
F: 'bg-primary',
G: 'bg-success',
H: 'bg-danger',
I: 'bg-warning',
J: 'bg-info',
K: 'bg-primary',
L: 'bg-success',
M: 'bg-danger',
N: 'bg-warning',
O: 'bg-info',
P: 'bg-primary',
Q: 'bg-success',
R: 'bg-danger',
S: 'bg-warning',
T: 'bg-info',
U: 'bg-primary',
}
sectorLetters: string[] = [];
sectorPurchases: number[] = [];
sectorLimit: number = 10;