Commit cf376333 authored by xinzhedeai's avatar xinzhedeai

详情内页,图表坐标值max min设置

parent 991c7e3b
...@@ -399,11 +399,13 @@ ...@@ -399,11 +399,13 @@
const result = res.data.body; const result = res.data.body;
if (result) { if (result) {
const max = result.max const max = result.max
const min = result.min
if(max){ if(max){
chartsOption.yAxis[0].max = max chartsOption.yAxis[0].max = max
chartsOption.yAxis[0].min = -max chartsOption.yAxis[0].min = min || -5
chartsOption.yAxis[1].max = max chartsOption.yAxis[1].max = max
chartsOption.yAxis[1].min = -max chartsOption.yAxis[1].min = min || -5
} }
chartsOption.xAxis.data = result.xData.data chartsOption.xAxis.data = result.xData.data
......
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
show: true show: true
}, },
axisTick: { show: true }, axisTick: { show: true },
min: -20, // min: -20,
max: 50, max: 50,
title: { title: {
text: 'Precipitation', // 这是你的 Y 轴标题 text: 'Precipitation', // 这是你的 Y 轴标题
...@@ -290,7 +290,7 @@ ...@@ -290,7 +290,7 @@
show: true show: true
}, },
axisTick: { show: true }, axisTick: { show: true },
min: -20, // min: -20,
max: 50, max: 50,
}], }],
grid: { right: 45, top: 10, left: 40, bottom: 25 }, grid: { right: 45, top: 10, left: 40, bottom: 25 },
...@@ -331,11 +331,12 @@ ...@@ -331,11 +331,12 @@
if (result) { if (result) {
const max = result.max // 必返 const max = result.max // 必返
const min = result.min // 必返
if(max){ if(max){
chartsOption.yAxis[0].max = max chartsOption.yAxis[0].max = max
chartsOption.yAxis[0].min = -20 chartsOption.yAxis[0].min = min || -5
chartsOption.yAxis[1].max = max chartsOption.yAxis[1].max = max
chartsOption.yAxis[1].min = -20 chartsOption.yAxis[1].min = min || -5
} }
chartsOption.xAxis.data = result.xData.data chartsOption.xAxis.data = result.xData.data
......
...@@ -333,6 +333,14 @@ ...@@ -333,6 +333,14 @@
}).then(res => { }).then(res => {
const result = res.data.body; const result = res.data.body;
if (result) { if (result) {
const max = result.max // 必返
const min = result.min // 必返
if(max){
chartsOption.yAxis[0].max = max
chartsOption.yAxis[1].max = max
}
chartsOption.xAxis.data = result.xData.data chartsOption.xAxis.data = result.xData.data
chartsOption.series = result.yData.map((item, index) => { chartsOption.series = result.yData.map((item, index) => {
if(index===0){ if(index===0){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment