From 1ccee53a0f590a1201b4c70a5c2e3e4a5fbec1e8 Mon Sep 17 00:00:00 2001 From: "zyx.net" Date: Tue, 2 Aug 2022 11:58:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=94=B6=E9=9B=86=E7=99=BE?= =?UTF-8?q?=E5=88=86=E6=AF=94=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ParameterCollectionEchart.vue | 47 +++++++++++++------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/jero-web/src/views/projectManagement/components/ParameterCollectionEchart.vue b/jero-web/src/views/projectManagement/components/ParameterCollectionEchart.vue index 77439939d..9c77c4b8e 100644 --- a/jero-web/src/views/projectManagement/components/ParameterCollectionEchart.vue +++ b/jero-web/src/views/projectManagement/components/ParameterCollectionEchart.vue @@ -176,7 +176,27 @@ // data3.push(+(Math.random() + 0.3).toFixed(2)); // data4.push(+Math.random().toFixed(2)); - + let yAxis=[]; + let tooltip= {}; + let _this = this + if(this.queryParam.value === 1){ + yAxis = [ + { + type: 'value', + axisLabel: { + show: true, + interval: 'auto', + formatter: '{value} %' + }, + }, + ] + }else{ + yAxis=[ + { + type: 'value', + }, + ]; + } option = { legend: { data: [this.$t('Notatthe'), this.$t('Inthecollection'), this.$t('Submitted'), this.$t('SynchronizedLibrary')], @@ -195,7 +215,16 @@ axisPointer: { // 坐标轴指示器,坐标轴触发有效 type: 'line'// 默认为直线,可选为:'line' | 'shadow' }, - formatter: '{b}
{a0}: {c0}%
{a1}: {c1}%' + formatter: function (params) { + var html = params[0].name + "
"; + for (var i = 0; i < params.length; i++) { + html += params[i].marker + params[i].seriesName + ":" + params[i].value; + if (_this.queryParam.value == 1) { + html += "%"; + } + } + return html + "
"; + } }, xAxis: { data: xAxisData, @@ -210,17 +239,7 @@ // splitLine: { show: false }, // splitArea: { show: false } }, - yAxis: [ - { - type: 'value', - axisLabel: { - show: true, - interval: 'auto', - formatter: '{value} %' - }, - }, - - ], + yAxis: yAxis, grid: { left: '10%', bottom: '15%' @@ -286,7 +305,7 @@ ], }; - option && myChart.setOption(option); + option && myChart.setOption(option, true); }, mainLeftEcharts(data, color) {