Skip to content

Commit

Permalink
deleted echarts
Browse files Browse the repository at this point in the history
deleted echarts
  • Loading branch information
ljxi committed Sep 2, 2023
1 parent 5fd7947 commit b899453
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 117 deletions.
5 changes: 0 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@
</div>
</div>

<div class="card card-preview">
<!-- <div class="card-inner"></div> -->
<div id="dv" style="position: relative;height: 300px;overflow: hidden;"></div>
</div>

<div class="card card-preview">
<div class="card-inner">
<h6><em class="icon ni ni-info"></em>出口地址</h6>
Expand Down
113 changes: 1 addition & 112 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,115 +267,4 @@ document.addEventListener("visibilitychange", function() {
visibl = true
document.title = "网络面板"
}
});




var chartDom = document.getElementById('dv');
var myChart = echarts.init(chartDom);
var option;

option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
data: ['Speed', 'Local Ping', 'Global Ping']
},
toolbox: {
feature: {
saveAsImage: {}
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
name: "时间(s)",
boundaryGap: false,
}],
yAxis: [{
type: 'value',
name: "延迟(ms)",
splitLine: {
show: false
}
},
{
type: 'value',
name: "速率(MB/s)",
splitLine: {
show: false
}
}
],
series: [{
name: '速率',
type: 'line',
stack: 'Total',
yAxisIndex: 1,
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [{
name: new Date(),
value: now_global_ping
}]
},
{
name: '延迟',
type: 'line',
data: [{
name: new Date(),
value: now_global_ping
}]
}
]
};

option && myChart.setOption(option);

function dv() {
if (visibl) {
now = new Date()
option.series[0].data.push({
name: now.toString(),
value: [
now.getTime(), now_speed.toFixed(1)
]
})
// option.series[0].data.shift()
option.series[1].data.push({
name: now.toString(),
value: [
now.getTime(), now_local_ping
]
})
// option.series[1].data.shift()
// option.series[2].data.push({
// name: now.toString(),
// value: [
// now.getTime(), now_global_ping
// ]
// })
// option.series[2].data.shift()
myChart.setOption({
series: option.series
});
}
setTimeout(dv, 1000)
}

dv()
});

0 comments on commit b899453

Please sign in to comment.