diff --git a/src/components/home/LineChart.vue b/src/components/home/LineChart.vue index b9ed49e..bb7dc03 100644 --- a/src/components/home/LineChart.vue +++ b/src/components/home/LineChart.vue @@ -77,9 +77,16 @@ watch( boundaryGap: false, data: newValue.data?.map(item => formatDateTime('HH:mm:ss', item.timestamp)), }, - yAxis: { - type: 'value', - }, + yAxis: [ + { + type: 'value', + name: '温/湿度', + }, + { + type: 'value', + name: 'H₂O₂浓度/相对饱和度', + }, + ], series: [ { name: '温度', @@ -109,6 +116,7 @@ watch( data: newValue.data?.map(item => item.h2o2.toFixed(2)), symbol: 'circle', symbolSize: 2, + yAxisIndex: 1, lineStyle: { color: '#ffd700', width: 1, @@ -120,6 +128,7 @@ watch( data: newValue.data?.map(item => item.rs.toFixed(2)), symbol: 'circle', symbolSize: 2, + yAxisIndex: 1, lineStyle: { color: '#ff0000', width: 1,