add some style to dashboard

This commit is contained in:
Omar-Nabil
2024-07-22 07:11:47 -06:00
committed by Jose Alberto Hernandez
parent e810ce1e5e
commit 95c9161770
3 changed files with 27 additions and 17 deletions
@@ -78,11 +78,11 @@ export class AmountCollectedPieComponent implements OnInit {
setChart(data: any) { setChart(data: any) {
if (!this.chart) { if (!this.chart) {
this.chart = new Chart('collection-pie', { this.chart = new Chart('collection-pie', {
type: 'pie', type: 'doughnut',
data: { data: {
labels: ['Pending', 'Collected'], labels: ['Pending', 'Collected'],
datasets: [{ datasets: [{
backgroundColor: ['red', 'green'], backgroundColor: ['dodgerblue', 'red'],
data: data data: data
}] }]
}, },
@@ -78,11 +78,11 @@ export class AmountDisbursedPieComponent implements OnInit {
setChart(data: any) { setChart(data: any) {
if (!this.chart) { if (!this.chart) {
this.chart = new Chart('disbursement-pie', { this.chart = new Chart('disbursement-pie', {
type: 'pie', type: 'doughnut',
data: { data: {
labels: ['Pending', 'Disbursed'], labels: ['Pending', 'Disbursed'],
datasets: [{ datasets: [{
backgroundColor: ['red', 'yellow'], backgroundColor: ['dodgerblue', 'red'],
data: data data: data
}] }]
}, },
@@ -4,15 +4,15 @@ import { UntypedFormControl } from '@angular/forms';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
/** rxjs Imports */ /** rxjs Imports */
import { merge, forkJoin } from 'rxjs'; import { forkJoin, merge } from 'rxjs';
import { skip } from 'rxjs/operators'; import { skip } from 'rxjs/operators';
/** Custom Services */ /** Custom Services */
import { HomeService } from '../../home.service'; import { HomeService } from '../../home.service';
/** Charting Imports */ /** Charting Imports */
import Chart from 'chart.js';
import { Dates } from 'app/core/utils/dates'; import { Dates } from 'app/core/utils/dates';
import Chart from 'chart.js';
/** /**
* Client Trends Bar Chart Component. * Client Trends Bar Chart Component.
@@ -218,30 +218,40 @@ export class ClientTrendsBarComponent implements OnInit {
setChart(labels: any[], clientCounts: number[], loanCounts: number[]) { setChart(labels: any[], clientCounts: number[], loanCounts: number[]) {
if (!this.chart) { if (!this.chart) {
this.chart = new Chart('client-trends-bar', { this.chart = new Chart('client-trends-bar', {
type: 'bar', type: 'line',
data: { data: {
labels: labels, labels: labels,
datasets: [ datasets: [
{ {
label: 'New Clients', label: 'New Clients',
data: clientCounts,
backgroundColor: 'dodgerblue', backgroundColor: 'dodgerblue',
data: clientCounts borderColor: 'dodgerblue',
borderWidth: 2,
fill: false
}, },
{ {
label: 'Loans Disbursed', label: 'Loans Disbursed',
backgroundColor: 'green', data: loanCounts,
data: loanCounts backgroundColor: 'red',
borderColor: 'red',
borderWidth: 2,
fill: false,
} }
] ]
}, },
options: { options: {
layout: { responsive: true,
padding: { scales: {
top: 5, y: {
left: 10, beginAtZero: true,
right: 10 scaleLabel: {
} display: true,
} labelString: 'Values',
fontColor: '#1074B9'
}
},
}
} }
}); });
} else { } else {