fix: 折线图初始化逻辑优化

This commit is contained in:
@changcode
2023-01-10 09:20:26 +08:00
parent a31c408327
commit 9f488adcb9

View File

@@ -702,14 +702,10 @@ export default {
this.myChart = null
this.chartOption = null
this.timer = setTimeout(() => {
if (this.lineTab) {
if (this.lineTab === 'total' && this.metric === 'Sessions/s') {
this.init()
} else {
const data = this.mpackets.find(t => t.class === this.lineTab)
if (data && data.positioning) {
this.activeChange(data, data.positioning)
}
if (this.lineTab && this.metric !== 'Sessions/s') {
const data = this.mpackets.find(t => t.class === this.lineTab)
if (data && data.positioning) {
this.activeChange(data, data.positioning)
}
} else {
this.init()