commit
241e29f705
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div id="ConsoleNet" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
|
||||
<ve-line ref="ConsoleNet" :data="chartData" :extend="extend" :settings="chartSettings" width="100%" height="100%" ></ve-line>
|
||||
<ve-line ref="ConsoleNet" :data="chartData" :extend="extend" :settings="chartSettings" :events="chartEvents" width="100%" height="100%" ></ve-line>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -59,12 +59,54 @@ export default {
|
|||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter: (data)=>{
|
||||
return data[1].marker + "下载:" + parseFloat(data[1].data[1]).toFixed(2) + "Mbps" + "</br> "+ data[0].marker +" 上传:" + parseFloat(data[0].data[1]).toFixed(2) + "Mbps";
|
||||
let in_sel = true;
|
||||
let out_sel = true;
|
||||
for (let key in this.extend.legend.selected) {
|
||||
if (key == "上传") {
|
||||
out_sel = this.extend.legend.selected[key];
|
||||
}
|
||||
if (key == "下载") {
|
||||
in_sel = this.extend.legend.selected[key];
|
||||
}
|
||||
}
|
||||
if (out_sel && in_sel) {
|
||||
return (
|
||||
data[1].marker +
|
||||
"下载:" +
|
||||
parseFloat(data[1].data[1]).toFixed(2) +
|
||||
"Mbps" +
|
||||
"</br> " +
|
||||
data[0].marker +
|
||||
"上传:" +
|
||||
parseFloat(data[0].data[1]).toFixed(2) +
|
||||
"Mbps"
|
||||
);
|
||||
} else if (out_sel)
|
||||
return (
|
||||
data[0].marker +
|
||||
"上传:" +
|
||||
parseFloat(data[0].data[1]).toFixed(2) +
|
||||
"Mbps"
|
||||
);
|
||||
else if (in_sel)
|
||||
return (
|
||||
data[0].marker +
|
||||
"下载:" +
|
||||
parseFloat(data[0].data[1]).toFixed(2) +
|
||||
"Mbps"
|
||||
);
|
||||
return "";
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
left: "center",
|
||||
bottom: "15px",
|
||||
selected: {},
|
||||
}
|
||||
}
|
||||
chartEvents: {
|
||||
legendselectchanged: (item) => {
|
||||
this.extend.legend.selected = item.selected;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue