fixed icon colours and icons

This commit is contained in:
piratefinn 2018-06-18 12:08:50 +01:00
parent 54f2ad832d
commit 090b3a65cb
2 changed files with 8 additions and 1 deletions

View file

@ -147,7 +147,7 @@
<ul class="icons-list"> <ul class="icons-list">
<!-- New loop --> <!-- New loop -->
<li *ngFor="let category of totalCategoryList | slice:0:totalCategoryLimit; let i=index"> <li *ngFor="let category of totalCategoryList | slice:0:totalCategoryLimit; let i=index">
<i [ngClass]="[ 'icon-question', 'bg-info']"></i> <i [ngClass]="['icon-' + category.icon, getBootstrapColour(i)]"></i>
<div class="desc"> <div class="desc">
<div class="title">{{ category.category || 'N/A' }}</div> <div class="title">{{ category.category || 'N/A' }}</div>
</div> </div>

View file

@ -25,6 +25,9 @@ export class DashboardCustomerComponent implements OnInit {
disableCategoryButton: boolean = false; disableCategoryButton: boolean = false;
public bootstrapColours: string[] = ['bg-primary', 'bg-secondary', 'bg-success',
'bg-danger', 'bg-warning', 'bg-info'];
public chartType = 'doughnut'; public chartType = 'doughnut';
public chartLegend = true; public chartLegend = true;
public doughnutChartDataCategory: any[] = []; public doughnutChartDataCategory: any[] = [];
@ -205,6 +208,10 @@ export class DashboardCustomerComponent implements OnInit {
this.totalCategoryLimit = 30; this.totalCategoryLimit = 30;
} }
public getBootstrapColour(index: number) {
return this.bootstrapColours[index % this.bootstrapColours.length];
}
public convertHex(hex: string, opacity: number) { public convertHex(hex: string, opacity: number) {
hex = hex.replace('#', ''); hex = hex.replace('#', '');
const r = parseInt(hex.substring(0, 2), 16); const r = parseInt(hex.substring(0, 2), 16);