From 4a92396a31e5fd5755391ed9d99c486845b0db0e Mon Sep 17 00:00:00 2001 From: qianming Date: Thu, 20 Jan 2022 15:04:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E6=9F=B1=E7=BA=BF=E5=9B=BE=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E6=95=B0=E6=8D=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/bar/widgetMoreBarLineChart.vue | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue index 675d6f5c..59e12ea1 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetMoreBarLineChart.vue @@ -383,7 +383,6 @@ export default { const legendName = optionsSetup.legendName; if (legendName != null) { const arr = legendName.split("|"); - console.log(arr) legend.data = arr; } }, @@ -500,13 +499,15 @@ export default { renderingFn(val) { const optionsSetup = this.optionsSetup; this.options.xAxis.data = val.xAxis; - this.options.series = val.series; + const series = []; + // this.options.series = val.series; const legendName = []; for (const i in val.series) { + const obj = {}; if (val.series[i].type == "bar") { - val.series[i].name = val.series[i].name; - val.series[i].type = val.series[i].type; - val.series[i].label = { + obj.name = val.series[i].name; + obj.type = val.series[i].type; + obj.label = { show: optionsSetup.isShowBar, position: "top", distance: optionsSetup.distanceBar, @@ -514,33 +515,34 @@ export default { color: optionsSetup.subTextColorBar, fontWeight: optionsSetup.fontWeightBar }; - val.series[i].barWidth = optionsSetup.maxWidth; - val.series[i].itemStyle = { + obj.barWidth = optionsSetup.maxWidth; + obj.itemStyle = { normal: { barBorderRadius: optionsSetup.radius, } }; - val.series[i].data = val.series[i].data; + obj.data = val.series[i].data; + series.push(obj); } else if (val.series[i].type == "line") { - val.series[i].name = val.series[i].name; - val.series[i].type = val.series[i].type; - val.series[i].yAxisIndex = 1; - val.series[i].showSymbol = optionsSetup.markPoint; - val.series[i].symbolSize = optionsSetup.pointSize; - val.series[i].smooth = optionsSetup.smoothCurve; + obj.name = val.series[i].name; + obj.type = val.series[i].type; + obj.yAxisIndex = 1; + obj.showSymbol = optionsSetup.markPoint; + obj.symbolSize = optionsSetup.pointSize; + obj.smooth = optionsSetup.smoothCurve; if (optionsSetup.area) { - val.series[i].areaStyle = { + obj.areaStyle = { opacity: optionsSetup.areaThickness / 100 }; } else { - val.series[i].areaStyle = { + obj.areaStyle = { opacity: 0 }; } - val.series[i].lineStyle = { + obj.lineStyle = { width: optionsSetup.lineWidth }; - val.series[i].label = { + obj.label = { show: optionsSetup.isShowLine, position: "top", distance: optionsSetup.distanceLine, @@ -548,11 +550,13 @@ export default { color: optionsSetup.subTextColorLine, fontWeight: optionsSetup.fontWeightLine }; - val.series[i].data = val.series[i].data; - }; + obj.data = val.series[i].data; + series.push(obj); + } legendName.push(val.series[i].name); - }; - this.options.legend["data"] = legendName; + } + this.options.legend["data"] = legendName; + this.options.series = series; } } };