参数收集百分比修改

This commit is contained in:
zyx.net
2022-08-02 11:58:58 +08:00
parent d361017136
commit 1ccee53a0f
@@ -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}<br />{a0}: {c0}%<br />{a1}: {c1}%'
formatter: function (params) {
var html = params[0].name + "<br>";
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 + "<br>";
}
},
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) {