diff --git a/src/views/centerairC/sysMonitor/components/hostChart.vue b/src/views/centerairC/sysMonitor/components/hostChart.vue index c9eb6e9..da9e4c5 100644 --- a/src/views/centerairC/sysMonitor/components/hostChart.vue +++ b/src/views/centerairC/sysMonitor/components/hostChart.vue @@ -273,6 +273,7 @@ export default { if (chartRef) { // 初始化图表的代码 this.chartInstance = echarts.init(this.$refs.chart_ref); + const titleFontSize = this.$refs.chart_ref.offsetWidth / 130; this.option = { tooltip: { trigger: "axis", @@ -312,12 +313,16 @@ export default { } return res; }, + textStyle: { + fontSize: titleFontSize * 1.5, + }, }, legend: { show: true, top: 0, textStyle: { color: "white", + fontSize: titleFontSize * 1.5, }, }, grid: { @@ -336,6 +341,9 @@ export default { // interval: 0, //强制显示所有x轴数据 // rotate: 30, //x轴坐标字体倾斜30度 color: "rgba(255, 255, 255, 1)", + textStyle: { + fontSize: titleFontSize * 1.5, + }, }, axisTick: { show: false, // 不显示坐标轴刻度线 @@ -363,13 +371,16 @@ export default { // 设置 name 的样式 nameTextStyle: { color: "rgba(255, 255, 255, 1)", - fontSize: 12, + fontSize: titleFontSize * 2, }, miniInterval: 5, type: "value", // 修饰刻度标签的颜色即y坐标数据 axisLabel: { color: "rgba(255, 255, 255, 1)", + textStyle: { + fontSize: titleFontSize * 1.5, + }, }, // 显示y坐标轴 axisLine: { @@ -396,18 +407,17 @@ export default { // 设置 name 的样式 nameTextStyle: { color: "rgba(255, 255, 255, 1)", - fontSize: 12, + fontSize: titleFontSize * 1.5, }, miniInterval: 5, type: "value", name: "负载", // y 轴的单位描述 // 修饰刻度标签的颜色即y坐标数据 - axisLabel: { - color: "#ffffff", - }, - // 修饰刻度标签的颜色即y坐标数据 axisLabel: { color: "rgba(255, 255, 255, 1)", + textStyle: { + fontSize: titleFontSize * 1.5, + }, }, // 显示y坐标轴 axisLine: { diff --git a/src/views/centerairC/sysMonitor/components/loadData.vue b/src/views/centerairC/sysMonitor/components/loadData.vue index dc031d7..d03854c 100644 --- a/src/views/centerairC/sysMonitor/components/loadData.vue +++ b/src/views/centerairC/sysMonitor/components/loadData.vue @@ -6,9 +6,6 @@