修复连续采集时没有时间间隔导致通讯失败从而导致无有法正常连续采集的问题 修改如下

This commit is contained in:
xin
2024-09-27 16:16:03 +08:00
parent 6d47134dac
commit e8d98f155d
37 changed files with 2361 additions and 257 deletions

View File

@ -48,12 +48,44 @@ export default {
let chart = echarts.getInstanceByDom(chartDom);
chart.setOption(this.option);
},
setplotname(params){
this.option.series[0].name=params.up;
this.option.legend.data[0]=params.up;
if (typeof params.donw!="undefined")
{
this.option.series[1].name=params.donw;
this.option.legend.data[1]=params.donw;
}else{
//如果大于1个数据 则删最后一个
if (this.option.series.length>1)
{
this.option.series.pop();
this.option.legend.data.pop();
}
}
const chartDom = this.$refs.chart;
let chart = echarts.getInstanceByDom(chartDom);
chart.setOption(this.option);
},
plotGraph(data, index) {
if (index>=1&&this.option.series.length < 2) {
this.option.series.push({
data: [], // 使用二维数组表示数据点的坐标
type: 'line',
name: 'DOWN',
symbol: 'none', // 不显示数据点
smooth: false, // 不使用平滑处理
//step: 'start' // 设置 step 类型的起始位置
});
}
this.option.series[index].data = data;
const chartDom = this.$refs.chart;
@ -132,7 +164,8 @@ export default {
left: '5%',
right: '5%',
bottom: '5%',
top: '5%'
top: '5%',
},
// visualMap: [
// {
@ -163,7 +196,7 @@ export default {
// },
series: [
{
data: [[1, 150], [2, 230], [3, 224], [4, 218], [5, 135], [6, 147], [7, 260]], // 使用二维数组表示数据点的坐标
data: [], // 使用二维数组表示数据点的坐标
type: 'line',
name: 'UP',
symbol: 'none', // 不显示数据点
@ -171,7 +204,7 @@ export default {
// step: 'start' // 设置 step 类型的起始位置
},
{
data: [[1, 150], [2, 230], [3, 224], [4, 218], [5, 135], [6, 147], [7, 260]], // 使用二维数组表示数据点的坐标
data: [], // 使用二维数组表示数据点的坐标
type: 'line',
name: 'DOWN',
symbol: 'none', // 不显示数据点
@ -207,7 +240,18 @@ export default {
console.log("resize")
const chartDom = this.$refs.chart;
let chart = echarts.getInstanceByDom(chartDom);
chart.resize()
chart.resize();
let width=chartDom.clientWidth;
if (width<800)
{
let option =this.option;
option.grid.left="10%";
chart.setOption(option);
}else{
let option =this.option;
option.grid.left="5%";
chart.setOption(option);
}
},