feat:完善功能
This commit is contained in:
@@ -17,41 +17,43 @@
|
||||
let options = ref([])
|
||||
const initChart = async () => {
|
||||
let res = await getAreaApi(params)
|
||||
if (option) {
|
||||
option.series[0].data = res.data
|
||||
} else {
|
||||
option = {
|
||||
legend: {
|
||||
top: '10%',
|
||||
itemWidth: fitChartSize(20),
|
||||
itemHeight: fitChartSize(20),
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: fitChartSize(20)
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '',
|
||||
type: 'pie',
|
||||
radius: ['30%', '60%'],
|
||||
center: ['50%', '56%'],
|
||||
roseType: 'area',
|
||||
labelLine: {
|
||||
normal: {
|
||||
show: true,
|
||||
length: 1
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: fitChartSize(10)
|
||||
},
|
||||
data: res.data
|
||||
}
|
||||
]
|
||||
if (res.data.length > 0) {
|
||||
if (option) {
|
||||
option.series[0].data = res.data
|
||||
} else {
|
||||
option = {
|
||||
legend: {
|
||||
top: '10%',
|
||||
itemWidth: fitChartSize(20),
|
||||
itemHeight: fitChartSize(20),
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: fitChartSize(20)
|
||||
}
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '',
|
||||
type: 'pie',
|
||||
radius: ['30%', '60%'],
|
||||
center: ['50%', '56%'],
|
||||
roseType: 'area',
|
||||
labelLine: {
|
||||
normal: {
|
||||
show: true,
|
||||
length: 1
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
borderRadius: fitChartSize(10)
|
||||
},
|
||||
data: res.data
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
setOption(option)
|
||||
}
|
||||
setOption(option)
|
||||
}
|
||||
const getStop = async () => {
|
||||
let res = await getSpotApi()
|
||||
|
||||
Reference in New Issue
Block a user