优化监控中心样式
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user