From 8b1000ebcfabd9484ac07645ee91e726fd7812bd Mon Sep 17 00:00:00 2001
From: guoshipeng <3194674006@qq.com>
Date: Mon, 31 Jul 2023 15:54:30 +0800
Subject: [PATCH] fix:显示坐标轴
---
src/views/contrast/index.vue | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/views/contrast/index.vue b/src/views/contrast/index.vue
index 85a3e86..330f7ff 100644
--- a/src/views/contrast/index.vue
+++ b/src/views/contrast/index.vue
@@ -1,5 +1,5 @@
+<template>
- <div style="width: 100%; height: 100%">
+ <div style="width: 100%; height: 100%; margin:0 auto">
<div class="topSelect">
<el-cascader
v-model="newMac"
@@ -57,7 +57,7 @@
<div style="position:absolute">(������:ug/m��)</div>
<div style="text-align: center;width: 100%;">{{ newData }}��{{ newMac?newMac[0]:'' }}��{{ newMac?newMac[newMac.length - 1][0]:'' }}��{{ value |sensorFilter }}�����������</div>
</div> -->
- <LineChart :chart-data="lineChartData" style="height: 23rem"/>
+ <LineChart :chart-data="lineChartData" style="height: 40rem;"/>
</div>
</template>
@@ -274,6 +274,7 @@
series: [],
xAxis: [],
title: [],
+ yAxis:[]
}
this.newXData = []
this.$request({
@@ -289,7 +290,6 @@
})
.then((res) => {
// console.log('������������������������������')
- console.log(res, 111)
const data = res.data
for (let i = 0; i < data.length; i++) {
data[i].name = this.$options.filters.sensorFilter(
@@ -300,10 +300,10 @@
newLineChartData.xAxis.push(data[0].timeValueList[i].time)
}
for (var i = 0; i < data.length; i++) {
- newLineChartData.series.push({ data: [], name: '', type: 'line' })
+ newLineChartData.series.push({ data: [], name: '', type: 'line' ,yAxisIndex:data[i].code,lineStyle:{width:4}})
+ // newLineChartData.yAxis.push({})
newLineChartData.series[i].name = data[i].name
newLineChartData.title.push(data[i].name);
- console.log(newLineChartData.series[i].name);
for (var j = 0; j < data[i].timeValueList.length; j++) {
newLineChartData.series[i].data.push(data[i].timeValueList[j].value)
}
--
Gitblit v1.8.0