Browse Source

fix:图表双y轴

master
guoapeng 3 days ago
parent
commit
fdc90a91d5
  1. 11
      src/components/home/LineChart.vue

11
src/components/home/LineChart.vue

@ -77,9 +77,16 @@ watch(
boundaryGap: false,
data: newValue.data?.map(item => formatDateTime('HH:mm:ss', item.timestamp)),
},
yAxis: {
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,

Loading…
Cancel
Save