Skip to content

Commit

Permalink
add some style to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar-Nabil authored and alberto-art3ch committed Jul 22, 2024
1 parent e810ce1 commit 95c9161
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export class AmountCollectedPieComponent implements OnInit {
setChart(data: any) {
if (!this.chart) {
this.chart = new Chart('collection-pie', {
type: 'pie',
type: 'doughnut',
data: {
labels: ['Pending', 'Collected'],
datasets: [{
backgroundColor: ['red', 'green'],
backgroundColor: ['dodgerblue', 'red'],
data: data
}]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ export class AmountDisbursedPieComponent implements OnInit {
setChart(data: any) {
if (!this.chart) {
this.chart = new Chart('disbursement-pie', {
type: 'pie',
type: 'doughnut',
data: {
labels: ['Pending', 'Disbursed'],
datasets: [{
backgroundColor: ['red', 'yellow'],
backgroundColor: ['dodgerblue', 'red'],
data: data
}]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { UntypedFormControl } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';

/** rxjs Imports */
import { merge, forkJoin } from 'rxjs';
import { forkJoin, merge } from 'rxjs';
import { skip } from 'rxjs/operators';

/** Custom Services */
import { HomeService } from '../../home.service';

/** Charting Imports */
import Chart from 'chart.js';
import { Dates } from 'app/core/utils/dates';
import Chart from 'chart.js';

/**
* Client Trends Bar Chart Component.
Expand Down Expand Up @@ -218,30 +218,40 @@ export class ClientTrendsBarComponent implements OnInit {
setChart(labels: any[], clientCounts: number[], loanCounts: number[]) {
if (!this.chart) {
this.chart = new Chart('client-trends-bar', {
type: 'bar',
type: 'line',
data: {
labels: labels,
datasets: [
{
label: 'New Clients',
data: clientCounts,
backgroundColor: 'dodgerblue',
data: clientCounts
borderColor: 'dodgerblue',
borderWidth: 2,
fill: false
},
{
label: 'Loans Disbursed',
backgroundColor: 'green',
data: loanCounts
data: loanCounts,
backgroundColor: 'red',
borderColor: 'red',
borderWidth: 2,
fill: false,
}
]
},
options: {
layout: {
padding: {
top: 5,
left: 10,
right: 10
}
}
responsive: true,
scales: {
y: {
beginAtZero: true,
scaleLabel: {
display: true,
labelString: 'Values',
fontColor: '#1074B9'
}
},
}
}
});
} else {
Expand Down

0 comments on commit 95c9161

Please sign in to comment.