diff --git a/apps/angular/projects/ordering/src/pages/dashboard/components/order-status-chart/order-status-chart.component.html b/apps/angular/projects/ordering/src/pages/dashboard/components/order-status-chart/order-status-chart.component.html index 0a781728..67767856 100644 --- a/apps/angular/projects/ordering/src/pages/dashboard/components/order-status-chart/order-status-chart.component.html +++ b/apps/angular/projects/ordering/src/pages/dashboard/components/order-status-chart/order-status-chart.component.html @@ -9,8 +9,9 @@
diff --git a/apps/angular/projects/ordering/src/pages/dashboard/components/order-status-chart/order-status-chart.component.ts b/apps/angular/projects/ordering/src/pages/dashboard/components/order-status-chart/order-status-chart.component.ts index 90570ffb..9465457e 100644 --- a/apps/angular/projects/ordering/src/pages/dashboard/components/order-status-chart/order-status-chart.component.ts +++ b/apps/angular/projects/ordering/src/pages/dashboard/components/order-status-chart/order-status-chart.component.ts @@ -8,18 +8,31 @@ import { OrderStatusDto } from '../../../../lib/proxy/orders'; export class OrderStatusChartComponent { @Input() set data(value: OrderStatusDto[]) { - this.chartData.labels = [...value.map(x => x.orderStatus)]; + const filtered = value.filter(x => x.countOfStatusOrder > 0); this.chartData.datasets = [ { - label: 'Order Statuses', - data: [...value.map(x => x.countOfStatusOrder)], + data: [...filtered.map(x => x.countOfStatusOrder)], backgroundColor: ['#fdcb6e', '#0984e3', '#ff7675'], }, ]; + this.chartData.labels = [...filtered.map(x => x.orderStatus)]; } chartData = { labels: [], datasets: [], }; + + options = { + plugins: { + title: { + display: false, + text: '', + fontSize: 16, + }, + legend: { + position: 'bottom', + }, + }, + }; } diff --git a/apps/angular/projects/ordering/src/pages/dashboard/components/payments-chart/payments-chart.component.ts b/apps/angular/projects/ordering/src/pages/dashboard/components/payments-chart/payments-chart.component.ts index 265159d9..fc287008 100644 --- a/apps/angular/projects/ordering/src/pages/dashboard/components/payments-chart/payments-chart.component.ts +++ b/apps/angular/projects/ordering/src/pages/dashboard/components/payments-chart/payments-chart.component.ts @@ -10,7 +10,6 @@ export class PaymentsChartComponent { set data(value: PaymentDto[]) { this.chartData.datasets = [ { - label: 'Order Statuses', data: [...value.map(x => x.rateOfPaymentMethod)], backgroundColor: ['#fdcb6e', '#0984e3', '#ff7675'], }, @@ -26,9 +25,7 @@ export class PaymentsChartComponent { options = { plugins: { title: { - display: true, - text: 'Payment Methods', - fontSize: 16, + display: false, }, legend: { position: 'bottom',