fixed icon colours and icons

This commit is contained in:
piratefinn 2018-06-18 12:08:50 +01:00
parent 07af03cb51
commit 6a82c1fe62
2 changed files with 8 additions and 1 deletions

View file

@ -147,7 +147,7 @@
<ul class="icons-list">
<!-- New loop -->
<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="title">{{ category.category || 'N/A' }}</div>
</div>

View file

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