优化监控中心样式

This commit is contained in:
fks-yangshouda
2024-08-15 15:34:50 +08:00
parent 7e97118634
commit a47f8ae50f
9 changed files with 147 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div ref="graphGraphchart" style="width: 100%; height: 80%"></div>
<div ref="graphGraphchart" style="width: 100%; height: 100%"></div>
</template>
<script lang="ts">
@@ -77,6 +77,10 @@
legendList.push(data.value[i].name);
}
const option = {
grid: {
top: 40,
bottom: 50,
},
legend: {
data: legendList,
orient: 'horizontal',
@@ -107,6 +111,21 @@
type: 'value',
},
series: seriesList,
// 使用 ECharts 的 graphic 组件来展示无数据的提示
graphic:
data.value.length === 0
? {
type: 'text',
left: 'center',
top: 'middle',
style: {
text: '无数据',
fontSize: 20,
fontWeight: 'bold',
fill: '#999',
},
}
: null,
};
chartInstance = echarts.init(graphGraphchart.value);