From 547ed242381ea9f19831a50cbe5238fd7cad972e Mon Sep 17 00:00:00 2001 From: hanyuxia Date: Wed, 12 Feb 2020 19:26:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9BUG=201.dashboard?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=9B=BE=E8=A1=A8:=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=BC=82=E5=B8=B8=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=9B=BE=E8=A1=A8=EF=BC=88=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E9=AB=98=E5=BA=A6=E5=AF=BC=E8=87=B4=EF=BC=8C?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E9=AB=98=E5=BA=A6=E4=B9=8B=E5=90=8E=E5=86=8D?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=B0=83=E8=AF=95=E4=BF=AE=E6=94=B9=EF=BC=89?= =?UTF-8?q?=EF=BC=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/charts/line-chart-block.vue | 7 ++++++- .../src/components/page/dashboard/metricPreview.vue | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nezha-fronted/src/components/charts/line-chart-block.vue b/nezha-fronted/src/components/charts/line-chart-block.vue index 26955d95d..ca7405d4a 100644 --- a/nezha-fronted/src/components/charts/line-chart-block.vue +++ b/nezha-fronted/src/components/charts/line-chart-block.vue @@ -586,6 +586,7 @@ export default { option.title = title; this.echartStore.setOption(option);//创建图表 this.echartStore.hideLoading(); + this.echartStore.resize({height:chartInfo.height});//,width:`${ele.clientWidth-100}`} if(legend && legend.length>0){ this.legendList = []; legend.forEach((item, i) => { @@ -597,12 +598,13 @@ export default { this.isGrey.push(false); }); } + /* this.$nextTick(() => { let divHeight = this.$refs.legendArea.offsetHeight; let chartHeight = (chartInfo.height-divHeight); - //alert(chartInfo.title+"--"+chartHeight); this.echartStore.resize({height:chartHeight});//,width:`${ele.clientWidth-100}`} }); + */ } else if (chartSite === 'screen') { // 全屏显示 /* option.series = dataArg.map((item) => {// params.series = dataArg.map((item) => { @@ -654,6 +656,7 @@ export default { option.title = {}; this.echartModalStore.setOption(option);//显示全屏界面 this.echartModalStore.hideLoading(); + this.echartModalStore.resize({height:chartInfo.height}); if(legend && legend.length>0){ this.screenLegendList = []; legend.forEach((item, i) => { @@ -665,11 +668,13 @@ export default { this.isGreyScreen.push(false); }); } + /* this.$nextTick(() => { let divHeight = this.$refs.screenLegendArea.offsetHeight; let chartHeight = (chartInfo.height-divHeight); this.echartModalStore.resize({height:chartHeight}); }); + */ } }, handleLineFeed(str,chartWidth){ diff --git a/nezha-fronted/src/components/page/dashboard/metricPreview.vue b/nezha-fronted/src/components/page/dashboard/metricPreview.vue index a62ad2b0f..5a71a5713 100644 --- a/nezha-fronted/src/components/page/dashboard/metricPreview.vue +++ b/nezha-fronted/src/components/page/dashboard/metricPreview.vue @@ -309,7 +309,7 @@ export default { let host = '';//up, let charName=''; if(queryItem.metric.__name__){ - host = `${queryItem.metric.__name__}{`;//up, + host = `${queryItem.metric.__name__}`;//up, charName = `${queryItem.metric.__name__}`; } //let charName = `${queryItem.metric.__name__}`;