<template> <ve-pie :data="data" :settings="chartSettings"/> </template> <script> import { countByToilet, countByDay } from '@/api/statistics' export default { name: 'PieChart', data() { this.chartSettings = { labelMap: { 'cleanNum': '清洁次数', 'staticDate': '时间' }, metrics: ['cleanNum'], dimension: ['staticDate'] } this.extend = {} return { listQuery: { staticType: '', toiletId: '', startTime: '', endTime: '' }, data: { columns: ['staticDate', 'cleanNum'], rows: [] } } }, methods: { fetchData(params){ this.listQuery = params countByDay(this.listQuery).then(response => { this.data.rows = response.data }) } } } </script> <style rel="stylesheet/scss" lang="scss" scoped> .chart-title{ margin: auto; text-align: center; margin-top: 15px; font-size:20px; font-weight:600 } .select-right{ /*margin-right: 25px;*/ margin-top: 15px; /*width: 200px*/ } </style>