| | |
| | | tmp_index++; |
| | | } |
| | | } |
| | | }else{ |
| | | haoutil.msg("无查询记录,请更换查询条件!"); |
| | | } |
| | | }, |
| | | error: function (request, textStatus) { |
| | | |
| | | haoutil.msg("查询错误,请联系管理员!!!") |
| | | } |
| | | }); |
| | | } |
| | |
| | | $('#echart').removeAttr('_echarts_instance_'); |
| | | } |
| | | var backend_url = params.nodejs_url_predix + "dataapi/Bdata?bid=get_" + params.layerid + "_history&datatype=" + params.datatype + "&siteid=" + params.siteid + "&datatime=" + params.datatime + "&count=10"; |
| | | var legendData = all_layer_legends[params.layerid]; |
| | | // all 1006xx layer has the same legend !! |
| | | var layerid = params.layerid+""; |
| | | |
| | | var legendData = all_layer_legends[layerid.substring(0,4)]; |
| | | var legendData_selected = {}; |
| | | legendData.forEach(element => { |
| | | if (element==params.selected_qindex.toUpperCase()){ |
| | |
| | | title: { |
| | | text: tableData[0]["name"], |
| | | textStyle: { |
| | | color: '#fff', //颜色 |
| | | color: '#87CEFA', //颜色 |
| | | }, |
| | | top: '20px', |
| | | x: 'center' |
| | | }, |
| | | |
| | | |
| | | legend: { |
| | | // orient 设置布局方式,默认水平布局,可选值:'horizontal'(水平) ¦ 'vertical'(垂直) |
| | | orient: 'horizontal', |
| | |
| | | // y 设置垂直安放位置,默认全图顶端,可选值:'top' ¦ 'bottom' ¦ 'center' ¦ {number}(y坐标,单位px) |
| | | y: 'top', |
| | | textStyle: { //图例文字的样式 |
| | | color: '#fff', |
| | | color: '#87CEFA', |
| | | }, |
| | | data: legendData, |
| | | selected:legendData_selected, |
| | |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | |
| | | toolbox:{ |
| | | feature: { |
| | | saveAsImage: { type:'jpeg'}, |
| | | dataView: {}, |
| | | magicType: { |
| | | type: ['line', 'bar'], |
| | | option: { |
| | | // 类型切换时,下述配置项将被merge到对应类型的图表 series 中 |
| | | line: { smooth: true }, |
| | | bar: { label: { show: true } } |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | xAxis: { |
| | | name: '时间', |
| | | type: 'category', |
| | | axisLine: { |
| | | lineStyle: { |
| | | // 设置x轴颜色 |
| | | color: '#912CEE' |
| | | color: '#87CEFA' |
| | | } |
| | | }, |
| | | // 设置X轴数据旋转倾斜 |
| | | axisLabel: { |
| | | rotate: 60, // 旋转角度 |
| | | color: '#fff', //坐标的字体颜色 |
| | | color: '#87CEFA', //坐标的字体颜色 |
| | | interval: 0 //设置X轴数据间隔几个显示一个,为0表示都显示 |
| | | }, |
| | | // boundaryGap值为false的时候,折线第一个点在y轴上 |
| | |
| | | } |
| | | }, |
| | | },{ |
| | | name: 'CO(μg/m³)', |
| | | name: 'CO(mg/m³)', |
| | | type: 'value', |
| | | axisLine: { |
| | | lineStyle: { |
| | |
| | | }; |
| | | myCharts = echarts.init(document.getElementById('echart')); |
| | | myCharts.setOption(options, true); |
| | | window.onresize = function(){ |
| | | myCharts.resize(); |
| | | } |
| | | }else{ |
| | | haoutil.msg("无查询记录,请更换查询条件!"); |
| | | } |
| | | }, |
| | | error: function (request, textStatus) { |
| | | |
| | | haoutil.msg("查询错误,请联系管理员!!!") |
| | | } |
| | | }); |
| | | } |