|
@@ -351,20 +351,31 @@ export default {
|
|
}
|
|
}
|
|
let option = JSON.parse(JSON.stringify(weatherLineOption))
|
|
let option = JSON.parse(JSON.stringify(weatherLineOption))
|
|
option.grid = {
|
|
option.grid = {
|
|
- top: '5%',
|
|
|
|
|
|
+ top: '20%',
|
|
left: '3%',
|
|
left: '3%',
|
|
right: '3%',
|
|
right: '3%',
|
|
bottom: '5%',
|
|
bottom: '5%',
|
|
}
|
|
}
|
|
|
|
+ let legend = []
|
|
|
|
+ let series = []
|
|
let index = 0;
|
|
let index = 0;
|
|
|
|
+ option.tooltip.enterable = true
|
|
|
|
+ option.tooltip.formatter = function (params){
|
|
|
|
+ let str ='<div style="max-height: calc(55vh);overflow-y: auto">'
|
|
|
|
+ for(let param of params){
|
|
|
|
+ str = str +'<div class="flex justify-between"><div>'+param.marker+ param.seriesName+'</div><div class="ml-0 mr-0">'+param.value+'</div></div>'
|
|
|
|
+ }
|
|
|
|
+ str = str +'</div>'
|
|
|
|
+ return str
|
|
|
|
+
|
|
|
|
+ }
|
|
this.$axios({url: '/largeScreenController/forecastNwpFull', method: 'get',params: queryParams}).then(response => {
|
|
this.$axios({url: '/largeScreenController/forecastNwpFull', method: 'get',params: queryParams}).then(response => {
|
|
let stationObj = response.data
|
|
let stationObj = response.data
|
|
for (let key in stationObj) {
|
|
for (let key in stationObj) {
|
|
for (let i = 0; i < stationObj[key].length; i++) {
|
|
for (let i = 0; i < stationObj[key].length; i++) {
|
|
stationObj[key][i] = stationObj[key][i] == -99 ? null : stationObj[key][i]
|
|
stationObj[key][i] = stationObj[key][i] == -99 ? null : stationObj[key][i]
|
|
}
|
|
}
|
|
- option.legend.data.push(key)
|
|
|
|
-
|
|
|
|
|
|
+ legend.push(key)
|
|
let sValue = {
|
|
let sValue = {
|
|
name: key,
|
|
name: key,
|
|
type: 'line',
|
|
type: 'line',
|
|
@@ -378,13 +389,12 @@ export default {
|
|
width: 2
|
|
width: 2
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- itemStyle: this.lineStyle[index].itemStyle,
|
|
|
|
|
|
+ itemStyle: this.lineStyle[index] !== undefined ? this.lineStyle[index].itemStyle:{},
|
|
data: stationObj[key]
|
|
data: stationObj[key]
|
|
}
|
|
}
|
|
- option.series.push(sValue)
|
|
|
|
|
|
+ series.push(sValue)
|
|
index++;
|
|
index++;
|
|
}
|
|
}
|
|
-
|
|
|
|
if(sessionStorage.getItem('screen-weather-type')){
|
|
if(sessionStorage.getItem('screen-weather-type')){
|
|
if (sessionStorage.getItem('screen-weather-type').includes('wind')){
|
|
if (sessionStorage.getItem('screen-weather-type').includes('wind')){
|
|
option.yAxis[0].name='m/s'
|
|
option.yAxis[0].name='m/s'
|
|
@@ -396,6 +406,8 @@ export default {
|
|
}else{
|
|
}else{
|
|
option.yAxis[0].name='m/s'
|
|
option.yAxis[0].name='m/s'
|
|
}
|
|
}
|
|
|
|
+ option.legend.data = legend
|
|
|
|
+ option.series = series
|
|
this.fullChart = this.$echarts.init(document.getElementById('weatherFullChart'));
|
|
this.fullChart = this.$echarts.init(document.getElementById('weatherFullChart'));
|
|
this.fullChart.setOption(option, true)
|
|
this.fullChart.setOption(option, true)
|
|
}).catch(err => {
|
|
}).catch(err => {
|