daikins/.svn/pristine/54/54850dc588585ee9f2ce335b6cc...

42 lines
885 B
Plaintext

import * as echarts from "echarts";
import {topStat} from '@/api/daikin/base'
import {getPreviousMonths} from '@/utils/format'
export function useChart21() {
const chartRef = ref()
const optionRef = ref()
getData()
async function getData() {
const { data } = await topStat();
const option = {
legend: {},
title:{text:'件',textStyle:{'fontSize':14,'fontWeight':500},subtext:'数',top:'45%'},
tooltip: {
trigger: 'axis',
axisPointer: {
animation: false
}
},
grid: {
left: '6%',
right: '4%',
bottom: '5%',
containLabel: true
},
yAxis: {
type: 'value',
show:true,
},
xAxis: {
type: 'category',
data: getPreviousMonths()
},
series:data
}
optionRef.value =option
}
return { chartRef, option:optionRef }
}