import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-order-statistics', templateUrl: './order-statistics.component.html', styleUrls: ['./order-statistics.component.scss'] }) export class OrderStatisticsComponent implements OnInit { // 根据年月日查询总交易金额 orderStatisticsByYMDData: any; constructor() { } ngOnInit(): void { this.orderStatisticsByYMD(3); } public orderStatisticsByYMD(dateType: number): void { this.orderStatisticsByYMDData = { xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] }, yAxis: { type: 'value' }, series: [ { data: [120, 200, 150, 80, 70, 110, 130], label: { show: true, color: 'black', position: 'top' }, type: 'bar', showBackground: true, color: '#1890ff', backgroundStyle: { color: 'rgba(180, 180, 180, 0.2)' } } ] }; } }