From d9a6c67d58d7d6ba5c1f1a588cc640e8e8b40556 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Mon, 1 Aug 2022 17:52:22 +0800 Subject: [PATCH] =?UTF-8?q?style(=E6=8A=A5=E8=A1=A8=E7=BB=9F=E8=AE=A1):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=9B=BE=E8=A1=A8=E6=9C=80=E5=A4=A7=E5=8C=96=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015436 --user=宋天阳 【报表统计】项目报表-测试用例统计,柱状图表全屏展示有点丑 https://www.tapd.cn/55049933/s/1216749 --- .../service/TestCaseCountService.java | 10 +++++----- .../casecount/chart/TestCaseCountChart.vue | 11 ++++++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/backend/src/main/java/io/metersphere/reportstatistics/service/TestCaseCountService.java b/backend/src/main/java/io/metersphere/reportstatistics/service/TestCaseCountService.java index 81f2d4a73a..5a1f97f29e 100644 --- a/backend/src/main/java/io/metersphere/reportstatistics/service/TestCaseCountService.java +++ b/backend/src/main/java/io/metersphere/reportstatistics/service/TestCaseCountService.java @@ -496,11 +496,11 @@ public class TestCaseCountService { this.add("50%"); }}); - Map labelMap = new HashMap<>(); - Map normalMap = new HashMap<>(); - normalMap.put("show",true); - normalMap.put("formatter","{b}: {c}({d}%)"); - labelMap.put("normal",normalMap); + Map labelMap = new HashMap<>(); + Map normalMap = new HashMap<>(); + normalMap.put("show", true); + normalMap.put("formatter", "{b}: {c}({d}%)"); + labelMap.put("normal", normalMap); series.setLabel(labelMap); Title title = new Title(); diff --git a/frontend/src/business/components/reportstatistics/projectstatistics/casecount/chart/TestCaseCountChart.vue b/frontend/src/business/components/reportstatistics/projectstatistics/casecount/chart/TestCaseCountChart.vue index 4b7345b1cf..cc9ac7a427 100644 --- a/frontend/src/business/components/reportstatistics/projectstatistics/casecount/chart/TestCaseCountChart.vue +++ b/frontend/src/business/components/reportstatistics/projectstatistics/casecount/chart/TestCaseCountChart.vue @@ -31,7 +31,8 @@
@@ -148,14 +149,19 @@ export default { this.originalW = this.w; this.originalH = this.h; this.w = document.body.clientWidth - 50; - this.h = document.body.clientHeight; this.isFullScreen = true; + if (this.chartType === 'bar') { + this.chartWidthNumber = this.w; + } this.$emit('hidePage', true); }, unFullScreen() { this.w = this.originalW; this.h = this.originalH; this.isFullScreen = false; + if (this.chartType === 'bar') { + this.chartWidthNumber = this.w; + } this.$emit('hidePage', false); }, getImages(command) { @@ -167,7 +173,6 @@ export default { if (document.getElementById('picChart')) { let chartsCanvas = document.getElementById('picChart').querySelectorAll('canvas')[0]; if (chartsCanvas) { - // toDataURL()是canvas对象的一种方法,用于将canvas对象转换为base64位编码 returnImageDatas = chartsCanvas && chartsCanvas.toDataURL(imageType); } }