| | |
| | | if (legendData == null || legendData.length < 1) { |
| | | return; |
| | | } |
| | | |
| | | var colorData = echart_lines_color_list[tmpQueryParams.layerid]; |
| | | var myItemStyle = { |
| | | normal: { |
| | |
| | | console.log(timeLineData); |
| | | console.log(seriesData); |
| | | |
| | | //转换角标 |
| | | var newData = legendData; |
| | | for (var i=0; i<newData.length; i++){ |
| | | if(newData[i] == "pm25"){ |
| | | newData[i] = "PM₂.₅"; |
| | | } |
| | | if(newData[i] == "pm10"){ |
| | | newData[i] = "PM₁₀"; |
| | | } |
| | | if(newData[i] == "no"){ |
| | | newData[i] = "NO"; |
| | | } |
| | | if(newData[i] == "nox"){ |
| | | newData[i] = "NOₓ"; |
| | | } |
| | | if(newData[i] == "no2"){ |
| | | newData[i] = "NO₂"; |
| | | } |
| | | if(newData[i] == "co"){ |
| | | newData[i] = "CO"; |
| | | } |
| | | if(newData[i] == "so2"){ |
| | | newData[i] = "SO₂"; |
| | | } |
| | | if(newData[i] == "o3"){ |
| | | newData[i] = "O₃"; |
| | | } |
| | | if(newData[i] == "o31"){ |
| | | newData[i] = "O₃₁"; |
| | | } |
| | | if(newData[i] == "o38"){ |
| | | newData[i] = "O₃₈"; |
| | | } |
| | | if(newData[i] == "aqi"){ |
| | | newData[i] = "AQI"; |
| | | } |
| | | if(newData[i] == "tsp"){ |
| | | newData[i] = "TSP"; |
| | | } |
| | | }; |
| | | |
| | | options.legend.data = newData; |
| | | options.series.forEach((item,index)=>{item.name = legendData[index]}); |
| | | |
| | | //转换options下面selected里的角标 |
| | | options.legend.selected['PM₂.₅'] = options.legend.selected['pm25'] ; |
| | | delete options.legend.selected['pm25']; |
| | | options.legend.selected['PM₁₀'] = options.legend.selected['pm10'] ; |
| | | delete options.legend.selected['pm10']; |
| | | options.legend.selected['NO'] = options.legend.selected['no'] ; |
| | | delete options.legend.selected['no']; |
| | | options.legend.selected['NOₓ'] = options.legend.selected['nox'] ; |
| | | delete options.legend.selected['nox']; |
| | | options.legend.selected['NO₂'] = options.legend.selected['no2'] ; |
| | | delete options.legend.selected['no2']; |
| | | options.legend.selected['CO'] = options.legend.selected['co'] ; |
| | | delete options.legend.selected['co']; |
| | | options.legend.selected['SO₂'] = options.legend.selected['so2'] ; |
| | | delete options.legend.selected['so2']; |
| | | options.legend.selected['O₃'] = options.legend.selected['o3'] ; |
| | | delete options.legend.selected['o3']; |
| | | options.legend.selected['O₃₁'] = options.legend.selected['o31'] ; |
| | | delete options.legend.selected['o31']; |
| | | options.legend.selected['O₃₈'] = options.legend.selected['o38'] ; |
| | | delete options.legend.selected['o38']; |
| | | options.legend.selected['AQI'] = options.legend.selected['aqi'] ; |
| | | delete options.legend.selected['aqi']; |
| | | options.legend.selected['TSP'] = options.legend.selected['tsp'] ; |
| | | delete options.legend.selected['tsp']; |
| | | |
| | | |
| | | myCharts = echarts.init(document.getElementById('echart')); |
| | | myCharts.setOption(options, true); |
| | | window.onresize = function(){ |
| | | myCharts.resize(); |
| | | }; |
| | | |
| | | // 还原角标 |
| | | var RestoreData = newData; |
| | | for (var i=0; i<RestoreData.length; i++){ |
| | | if(RestoreData[i] == "PM₂.₅"){ |
| | | RestoreData[i] = "pm25"; |
| | | } |
| | | if(RestoreData[i] == "PM₁₀"){ |
| | | RestoreData[i] = "pm10"; |
| | | } |
| | | if(RestoreData[i] == "NO"){ |
| | | RestoreData[i] = "no"; |
| | | } |
| | | if(RestoreData[i] == "NOₓ"){ |
| | | RestoreData[i] = "nox"; |
| | | } |
| | | if(RestoreData[i] == "NO₂"){ |
| | | RestoreData[i] = "no2"; |
| | | } |
| | | if(RestoreData[i] == "CO"){ |
| | | RestoreData[i] = "co"; |
| | | } |
| | | if(RestoreData[i] == "SO₂"){ |
| | | RestoreData[i] = "so2"; |
| | | } |
| | | if(RestoreData[i] == "O₃"){ |
| | | RestoreData[i] = "o3"; |
| | | } |
| | | if(RestoreData[i] == "O₃₁"){ |
| | | RestoreData[i] = "o31"; |
| | | } |
| | | if(RestoreData[i] == "O₃₈"){ |
| | | RestoreData[i] = "o38"; |
| | | } |
| | | if(RestoreData[i] == "AQI"){ |
| | | RestoreData[i] = "aqi"; |
| | | } |
| | | if(RestoreData[i] == "TSP"){ |
| | | RestoreData[i] = "tsp"; |
| | | } |
| | | }; |
| | | |
| | | options.legend.data = RestoreData; |
| | | options.series.forEach((item,index)=>{item.name = legendData[index]}); |
| | | |
| | | }else{ |
| | | haoutil.msg("无查询记录,请更换查询条件!"); |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | ///// |
| | | function reloadData(params) { |
| | | |
| | | tmpQueryParams = params; |
| | |
| | | series: seriesData, |
| | | color: colorData |
| | | }; |
| | | |
| | | myCharts = echarts.init(document.getElementById('echart')); |
| | | myCharts.setOption(options, true); |
| | | window.onresize = function(){ |