From 3ae782fa3a527bed7d6d44e9a1ae804bc8ebf7a1 Mon Sep 17 00:00:00 2001 From: qianming Date: Thu, 19 Aug 2021 16:04:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A0=86=E5=8F=A0=E5=9B=BE=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/report/bigscreen/designer/tools.js | 6 +-- .../widget/bar/widgetBarStackChart.vue | 42 +++++++++---------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/report-ui/src/views/report/bigscreen/designer/tools.js b/report-ui/src/views/report/bigscreen/designer/tools.js index 689400d1..79f11fec 100644 --- a/report-ui/src/views/report/bigscreen/designer/tools.js +++ b/report-ui/src/views/report/bigscreen/designer/tools.js @@ -6136,12 +6136,12 @@ const widgetTools = [ }, ], }, - /*{ + { name: '图例操作', list: [ { type: 'el-switch', - label: '图例', + label: '显示', name: 'isShowLegend', required: false, placeholder: '', @@ -6209,7 +6209,7 @@ const widgetTools = [ value: 'horizontal' }, ], - },*/ + }, /*{ name: '自定义配色', list: [ diff --git a/report-ui/src/views/report/bigscreen/designer/widget/bar/widgetBarStackChart.vue b/report-ui/src/views/report/bigscreen/designer/widget/bar/widgetBarStackChart.vue index d2f42a85..a84af91f 100644 --- a/report-ui/src/views/report/bigscreen/designer/widget/bar/widgetBarStackChart.vue +++ b/report-ui/src/views/report/bigscreen/designer/widget/bar/widgetBarStackChart.vue @@ -98,8 +98,8 @@ export default { this.setOptionsY(); this.setOptionsTop(); this.setOptionsTooltip(); - //this.setOptionsMargin(); - //this.setOptionsLegend(); + this.setOptionsMargin(); + this.setOptionsLegend(); //this.setOptionsColor(); this.setOptionsData(); }, @@ -121,7 +121,6 @@ export default { fontWeight: optionsCollapse.subTextFontWeight, fontSize: optionsCollapse.subTextFontSize }; - this.options.title = title; }, // X轴设置 @@ -216,18 +215,18 @@ export default { this.options.series = series; }, // tooltip 提示语设置,鼠标放置显示 - setOptionsTooltip() { - const optionsCollapse = this.optionsSetup; - const tooltip = { - trigger: "item", - show: true, - textStyle: { - color: optionsCollapse.lineColor, - fontSize: optionsCollapse.tipsFontSize - } - }; - this.options.tooltip = tooltip; - }, + setOptionsTooltip() { + const optionsCollapse = this.optionsSetup; + const tooltip = { + trigger: "item", + show: true, + textStyle: { + color: optionsCollapse.lineColor, + fontSize: optionsCollapse.tipsFontSize + } + }; + this.options.tooltip = tooltip; + }, // 边距设置 setOptionsMargin() { const optionsCollapse = this.optionsSetup; @@ -245,15 +244,14 @@ export default { const optionsCollapse = this.optionsSetup; const legend = this.options.legend; legend.show = optionsCollapse.isShowLegend; - legend.left = optionsCollapse.lateralPosition == "left" ? 0 : "auto"; - legend.right = optionsCollapse.lateralPosition == "right" ? 0 : "auto"; + legend.left = optionsCollapse.lateralPosition; legend.top = optionsCollapse.longitudinalPosition == "top" ? 0 : "auto"; legend.bottom = optionsCollapse.longitudinalPosition == "bottom" ? 0 : "auto"; legend.orient = optionsCollapse.layoutFront; legend.textStyle = { color: optionsCollapse.lengedColor, - fontSize: optionsCollapse.fontSize + fontSize: optionsCollapse.lengedFontSize }; legend.itemWidth = optionsCollapse.lengedWidth; }, @@ -302,11 +300,11 @@ export default { return newArr; }, //获取堆叠样式 - getStackStyle(){ + getStackStyle() { const optionsSetup = this.optionsSetup; let style = "" if (optionsSetup.stackStyle == "upDown") { - style = "total" + style = "total" } return style }, @@ -339,8 +337,8 @@ export default { data: data, barGap: "0%", stack: this.getStackStyle(), - barWidth : optionsSetup.maxWidth, - label : { + barWidth: optionsSetup.maxWidth, + label: { show: optionsSetup.isShow, position: "top", distance: 10,