From b8e12d38b0643002700ae8555eae986d0556f121 Mon Sep 17 00:00:00 2001 From: qianming Date: Fri, 3 Nov 2023 15:51:50 +0800 Subject: [PATCH] =?UTF-8?q?bugfix--=E6=9F=B1=E7=8A=B6=E5=9B=BE=E7=AB=96?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/widget/bar/widgetBarchart.vue | 63 +++++++++++-------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue index bf658374..0103eadb 100644 --- a/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue +++ b/report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue @@ -151,6 +151,17 @@ export default { }, // 轴反转 inverse: optionsSetup.reversalX, + axisLabel : { + show: true, + interval: optionsSetup.textInterval, + // 文字角度 + rotate: optionsSetup.textAngleX, + textStyle: { + // 坐标文字颜色 + color: optionsSetup.colorX, + fontSize: optionsSetup.fontSizeX, + }, + }, axisLine: { show: true, lineStyle: { @@ -335,18 +346,6 @@ export default { } const legendName = []; legendName.push("bar"); - // x轴 - if (optionsSetup.verticalShow) { - this.options.xAxis.data = []; - this.options.yAxis.data = axis; - this.options.xAxis.type = "value"; - this.options.yAxis.type = "category"; - } else { - this.options.xAxis.data = axis; - this.options.yAxis.data = []; - this.options.xAxis.type = "category"; - this.options.yAxis.type = "value"; - } for (const i in series) { if (series[i].type == "bar") { series[i].type = "bar"; @@ -416,8 +415,20 @@ export default { } return str } + }; + // x轴 + if (optionsSetup.verticalShow) { + this.options.xAxis.data = []; + this.options.yAxis.data = axis; + this.options.xAxis.type = "value"; + this.options.yAxis.type = "category"; + } else { + this.options.xAxis.data = axis; + this.options.yAxis.data = []; + this.options.xAxis.type = "category"; + this.options.yAxis.type = "value"; + this.options.xAxis.axisLabel = axisLabel; } - this.options.xAxis.axisLabel = axisLabel; this.options.legend["data"] = legendName; this.setOptionsLegendName(legendName); }, @@ -451,18 +462,6 @@ export default { } const series = []; const legendName = []; - // x轴 - if (optionsSetup.verticalShow) { - this.options.xAxis.data = []; - this.options.yAxis.data = val.xAxis; - this.options.xAxis.type = "value"; - this.options.yAxis.type = "category"; - } else { - this.options.xAxis.data = val.xAxis; - this.options.yAxis.data = []; - this.options.xAxis.type = "category"; - this.options.yAxis.type = "value"; - } for (const i in val.series) { legendName.push(val.series[i].name); const obj = {}; @@ -537,8 +536,20 @@ export default { } return str } + }; + // x轴 + if (optionsSetup.verticalShow) { + this.options.xAxis.data = []; + this.options.yAxis.data = val.xAxis; + this.options.xAxis.type = "value"; + this.options.yAxis.type = "category"; + } else { + this.options.xAxis.data = val.xAxis; + this.options.yAxis.data = []; + this.options.xAxis.type = "category"; + this.options.yAxis.type = "value"; + this.options.xAxis.axisLabel = axisLabel; } - this.options.xAxis.axisLabel = axisLabel; this.options.series = series; this.options.legend["data"] = legendName; this.setOptionsLegendName(legendName);