var chart1; var chart2; var chart3; var chart4; var chart5; var chart6; var chart7; var chart8; var categor = ['0','1', '2', '3','4', '5', '6', '7', '8', '9', '10', '11', '12', '13','14', '15', '16', '17', '18','19', '20','21','22','23']; var options1; var options2; var options3; var options4; var options5; var options6; var options7; var options8; Highcharts.setOptions({ global : { useUTC : false } }); String.prototype.endWith=function(oString){ var reg=new RegExp(oString+"$"); return reg.test(this); }; function realPowerCharBy24() { var url = "/matrix/findRealPowerCharBy24.action"; $.ajax({ url : url, type : "post", cache : false, dataType : "json", async : false, data : {}, ifModified : false, success : function(result) { var yfdl = []; var gzdl = []; var whdl = []; var xddl = []; var qfdl = []; var sldl = []; var fs = []; var xtime = []; $.each(result, function(m, obj) { //if(m == result.length -1){ if (obj.value1 != null) { yfdl.push( parseFloat(obj.value1) ); } if (obj.value2 != null) { whdl.push( parseFloat(obj.value2) ); } if (obj.value3 != null) { gzdl.push( parseFloat(obj.value3) ); } if (obj.value4 != null) { xddl.push( parseFloat(obj.value4) ); } if (obj.value5 != null) { qfdl.push( parseFloat(obj.value5) ); } if (obj.value6 != null && obj.value6!=0) { fs.push( parseFloat(obj.value6) ); } if (obj.value7 != null ) { sldl.push( parseFloat(obj.value7) ); } if(obj.time!= null ) { xtime.push(parseFloat(obj.time)); } }); //alert(xtime.length); options2.series[0].data = yfdl; options2.series[1].data = gzdl; options2.series[2].data = whdl; options2.series[3].data = xddl; options2.series[4].data = qfdl; options2.series[5].data = sldl; options2.series[6].data = fs; options2.xAxis.categories = xtime; chart2 = new Highcharts.Chart(options2); } }); } function powercompareChat() { var url = "/matrix/powercompareChat.action"; $.ajax({ url : url, type : "post", cache : false, dataType : "json", async : false, data : {}, ifModified : false, success : function(result) { var lldl = []; var gfdl = []; $.each(result, function(m, obj) { if (obj.value1 != null) { lldl.push(obj.value1*-1-obj.value2); } if (obj.value2 != null) { gfdl.push(obj.value2); } }); options1.series[0].data = lldl; options1.series[1].data = gfdl; chart1 = new Highcharts.Chart(options1); } }); } function showChart() { /***************************************************************************************************/ $.ajax( { url : "/matrix/fdcPieChart.action", type : "post", cache : false, dataType : "json", data : {}, ifModified : false, success : function(result) { if (null!=result && result.length != 0) { eval(result); var xaixs = []; for ( var i = 0; i < result.length; i += 1) { var jsonObj1 = [ result[i].name, result[i].value1 ]; xaixs.push(jsonObj1); } options3.series[0].data = xaixs; chart3 = new Highcharts.Chart(options3); } } }); /***************************************************************************************************/ $.ajax( { url : "/matrix/lossPieChart.action", type : "post", cache : false, dataType : "json", data : {}, ifModified : false, success : function(result) { if (null!=result && result.length != 0) { eval(result); var xaixs = []; for ( var i = 0; i < result.length; i += 1) { var jsonObj1 = [ result[i].name, result[i].value1 ]; xaixs.push(jsonObj1); } options4.series[0].data = xaixs; chart4 = new Highcharts.Chart(options4); } } }); /***************************************************************************************************/ } function pointChart(){ $.ajax( { url : "/matrix/pointChart.action", type : "post", cache : false, dataType : "json", data : {}, ifModified : false, success : function(result) { if (null!=result && result.length != 0) { eval(result); var xaixs = []; var xtime = []; for ( var i = 0; i < result.length; i += 1) { var jsonObj1 = [result[i].name,parseFloat(result[i].value1)]; xaixs.push(jsonObj1); xtime.push(parseFloat(result[i].time)); } options5.series[0].data = xaixs; options5.xAxis.categories = xtime; //alert(options5.series[0].data); options5.xAxis.minTickInterval=xtime.length/24; chart5 = new Highcharts.Chart(options5); } } }); } /*************************************************************************************************/ $(document).ready(function () { // options1 = { // chart: {renderTo: 'chatyc',type: 'bar'}, // title: {text: ''}, // subtitle: {text: ''}, // xAxis: [{categories: categor, // reversed: false, // labels: { // step: 2 // } // }, { // opposite: true, // reversed: false, // categories: categor, // linkedTo: 0, // labels: { // step: 2 // } // }], // yAxis: {title: { // text: null // }, // labels: { // formatter: function () { // return Math.abs(this.value) + 'MWh'; // } // } // }, // plotOptions: { // series: { // stacking: 'normal' // } // }, // tooltip: { // formatter: function () { // return '' + this.series.name + ',截止上一时刻 ' + this.point.category + '时
' + // '电量: ' + Highcharts.numberFormat(Math.abs(this.point.y), 2)+'MWh'; // } // }, // series: [{ // name: '理论电量', // data: [] // }, { // name: '实发电量', // data: [] // }] // }; options1 = { chart: {renderTo: 'chatyc',type: 'bar'}, title: {text: ''}, subtitle: {text: ''}, xAxis: [{categories: categor, reversed: false, //linkedTo: 0, labels: { step: 2 } } , { opposite: true, reversed: false, //categories: categor, //linkedTo: 0, labels: { step: 2 } } ], yAxis: {title: { text: null }, min: 0, labels: { formatter: function () { return Math.abs(this.value) + 'MWh'; } } }, plotOptions: { series: { stacking: 'normal' } }, tooltip: { formatter: function () { console.log(this.series); var html = '' + this.series.name + ',截止上一时刻 ' + this.point.category + '时
'; if(this.series.name=='理论电量'){ html +='电量: ' + Highcharts.numberFormat(Math.abs(this.point.total), 2)+'MWh'; }else{ html +='电量: ' + Highcharts.numberFormat(Math.abs(this.point.y), 2)+'MWh'; } return html; } }, series: [{ name: '理论电量', data: [] }, { name: '实发电量', data: [] }] }; /*************************************************/ options2 = { colors: [ '#0BFEFA', //发电量 '#FD0100',//检修 '#FF7B16', //故障 '#D201D8',//限电 '#8085E9', //性能 '#A6A6A6', //受累 '#000000'//风速 ], chart: { renderTo: 'glqx_Chart', type: 'column', //backgroundColor:'#BFDFFF', //plotBackgroundColor:'#BFDFFF', zoomType: 'x' },title:null , xAxis: { type: 'datetime', labels: { align: 'center', formatter: function() { return Highcharts.dateFormat('%H
%M', this.value); } } }, yAxis: [{ // Primary yAxis labels: { format: '{value}万kw', style: { color: '#89A54E' } }, title: { text: '电量', style: { color: '#89A54E' } } }, { // Secondary yAxis title: { text: '风速', style: { color: '#4572A7' } }, labels: { format: '{value} m/s', style: { color: '#4572A7' } }, opposite: true }], legend: { layout: 'vertical', // backgroundColor: '#FFFFFF', align: 'right', verticalAlign: 'top', x:-80, floating: true // shadow: true // layout: 'vertical', // align: 'right', // verticalAlign: 'middle', // borderWidth: 0 }, tooltip: { shared:true, xDateFormat:'%Y-%m-%d %H:%M' /*formatter: function() { return ''+ this.series.name +':'+ Highcharts.numberFormat(this.y, 2) +' 万kW
时间:'+ Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x); }*/ }, series: [{ name: '日发电量(单位:万KWh)', yAxis:0 }, {name: '故障损失电量(单位:万KWh)', yAxis:0 },{ name: '检修损失电量(单位:万KWh)', yAxis:0 },{ name: '限电损失电量(单位:万KWh)', yAxis:0 } ,{ name: '性能损失电量(单位:万KWh)', yAxis:0 },{ name: '受累损失电量(单位:万KWh)', yAxis:0 },{ name: '风速(单位:m/s)', yAxis:1, type: 'spline' }] }; /***************************************************************************************************/ options3 = { chart : { renderTo : 'dltj_Chart_1', plotBackgroundColor : null, plotBorderWidth : null, plotShadow : false }, title : { text : '发电量占比' }, tooltip : { pointFormat : '{series.name}: {point.percentage:.1f}%' }, plotOptions : { pie : { allowPointSelect : true, cursor : 'pointer', dataLabels : { enabled : false, color : '#000000', connectorColor : '#000000', format : '{point.name}: {point.percentage:.1f} %' }, showInLegend : true } }, legend : { layout : 'vertical', align : 'right', verticalAlign : 'bottom', borderWidth : 0 }, series : [ { type : 'pie', name : '占比', data : [] } ] }; /***************************************************************************************************/ options4 = { colors: [ '#8085E9', //性能 '#FD0100',//检修 '#FF7B16', //故障 '#D201D8',//限电 '#00ff20' //受累 ], chart : { renderTo : 'dltj_Chart_2', plotBackgroundColor : null, plotBorderWidth : null, plotShadow : false }, title : { text : '损失电量占比' }, tooltip : { pointFormat : '{series.name}: {point.percentage:.1f}%' }, plotOptions : { pie : { allowPointSelect : true, cursor : 'pointer', dataLabels : { enabled : false, color : '#000000', connectorColor : '#000000', format : '{point.name}: {point.percentage:.1f} %' }, showInLegend : true } }, legend : { layout : 'vertical', align : 'right', verticalAlign : 'bottom', borderWidth : 0 }, series : [ { type : 'pie', name : '占比', data : [] } ] }; /***************************************************************/ options5 = { chart: { renderTo: 'pointChat', type: 'scatter', zoomType: 'xy' }, title: { text: '' }, xAxis: { type: 'datetime', labels: { align: 'center', formatter: function() { return Highcharts.dateFormat('%H:%M', this.value); } }, showLastLabel: true }, yAxis: { title: { text: '功率 (MW)' } }, legend: { layout: 'vertical', align: 'left', verticalAlign: 'top', x: 100, y: 70, floating: true, backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF', borderWidth: 1 }, plotOptions: { scatter: { marker: { radius: 2, states: { hover: { enabled: true, lineColor: 'rgb(100,100,100)' } } }, states: { hover: { marker: { enabled: false } } }, tooltip: { shared:true, xDateFormat:'%H:%M', pointFormat : '{point.name}
实际出力{point.y} MW' } } }, series: [{ name: '山西新能源', color: 'rgba(119, 152, 191, .5)', turboThreshold:1500, data: [] }] }; /*******************************************************************/ options6 = { chart: { renderTo: 'speedCL', type: 'solidgauge' }, title: null, pane: { center: ['50%', '85%'], size: '170%', startAngle: -90, endAngle: 90, background: { backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE', innerRadius: '60%', outerRadius: '100%', shape: 'arc' } }, tooltip: { enabled: false }, // the value axis yAxis: { stops: [ [0.1, '#55BF3B'], // green [0.5, '#DDDF0D'], // yellow [0.9, '#DF5353'] // red ], lineWidth: 0, minorTickInterval: null, tickPixelInterval: 400, tickWidth: 0, min: 0, max: 25, title: { y: 7, text: '' }, labels: { y: 16 } }, plotOptions: { solidgauge: { dataLabels: { y: 22, borderWidth: 0, useHTML: true } } }, credits: { enabled: false },series: [{ name: '风速', data: [6.66], dataLabels: { format: '
{y}
' + 'm/s
' }, tooltip: { valueSuffix: 'm/s' } }] }; /*******************************************************************/ options7 = { chart: { renderTo: 'speedKB', type: 'solidgauge' }, title: null, pane: { center: ['50%', '85%'], size: '170%', startAngle: -90, endAngle: 90, background: { backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE', innerRadius: '60%', outerRadius: '100%', shape: 'arc' } }, tooltip: { enabled: false }, // the value axis yAxis: { stops: [ [0.1, '#55BF3B'], // green [0.5, '#DDDF0D'], // yellow [0.9, '#DF5353'] // red ], lineWidth: 0, minorTickInterval: null, tickPixelInterval: 400, tickWidth: 0, min: 0, max: 25, title: { y: 7, text: '' }, labels: { y: 16 } }, plotOptions: { solidgauge: { dataLabels: { y: 22, borderWidth: 0, useHTML: true } } }, credits: { enabled: false },series: [{ name: '风速', data: [6.66], dataLabels: { format: '
{y}
' + 'm/s
' }, tooltip: { valueSuffix: 'm/s' } }] }; /*******************************************************************/ options8 = { chart: { renderTo: 'speedDX', type: 'solidgauge' }, title: null, pane: { center: ['50%', '85%'], size: '170%', startAngle: -90, endAngle: 90, background: { backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || '#EEE', innerRadius: '60%', outerRadius: '100%', shape: 'arc' } }, tooltip: { enabled: false }, // the value axis yAxis: { stops: [ [0.1, '#55BF3B'], // green [0.5, '#DDDF0D'], // yellow [0.9, '#DF5353'] // red ], lineWidth: 0, minorTickInterval: null, tickPixelInterval: 400, tickWidth: 0, min: 0, max: 25, title: { y: 7, text: '' }, labels: { y: 16 } }, plotOptions: { solidgauge: { dataLabels: { y: 22, borderWidth: 0, useHTML: true } } }, credits: { enabled: false },series: [{ name: '风速', data: [6.66], dataLabels: { format: '
{y}
' + 'm/s
' }, tooltip: { valueSuffix: 'm/s' } }] }; /***************************************************************/ realPowerCharBy24(); showChart(); wpAllInfoAjaxs() ; powercompareChat(); pointChart(); window.setInterval(realPowerCharBy24, 60000); window.setInterval(showChart, 60000); window.setInterval(wpAllInfoAjaxs, 60000); window.setInterval(powercompareChat, 60000); window.setInterval(pointChart, 60000); /*****************************************************************/ }); function getValueInfo(value) { if(value=="" || value==null || value==undefined ) { return "0.0"; }else { return value; } } function getValueToInt(value) { if(value=="" || value==null || value==undefined || value==0.0){ return "0"; }else{ return value; } } /*********************************************************************************/ function wpAllInfoAjaxs() { $.ajax( { url : "/matrix/wpAllInfoAjaxes.action", type : "post", cache : false, dataType : "json", data : {}, ifModified : false, success : function(res) { /********************************************************************************************************/ $("#CL_FDC_RFDL").html(getValueInfo(res["CL_FDC_RFDL"] )); $("#CL_FDC_LLFDL").html(getValueInfo(res["CL_FDC_LLFDL"] )); $("#CL_FDC_RSWDL").html(getValueInfo(res["CL_FDC_RSWDL"] )); $("#CL_FDC_SCADAFDL").html(getValueInfo(res["CL_FDC_SCADAFDL"] )); //$("#CL_FDC_YLYXS").html(getValueInfo(res["CL_FDC_YLYXS"] )); if(parseFloat(res["CL_FDC_FNLYL"])<80){ $("#CL_FDC_YLYXS").attr("style","color:red"); } $("#CL_FDC_YLYXS").html(getValueInfo(res["CL_FDC_FNLYL"] )); $("#CL_FDC_WHSS").html(getValueInfo(res["CL_FDC_WHSS"] )); $("#CL_FDC_FS").html(getValueInfo(res["CL_FDC_FS"] )); $("#CL_FDC_GZSS").html(getValueInfo(res["CL_FDC_GZSS"] )); $("#CL_FDC_GL").html(getValueInfo(res["CL_FDC_GL"] )); $("#CL_FDC_XDSS").html(getValueInfo(res["CL_FDC_XDSS"] )); $("#CL_FDC_LLGL").html(getValueInfo(res["CL_FDC_LLGL"] )); $("#CL_FDC_SLSS").html(getValueInfo(res["CL_FDC_SLSS"] )); $("#CL_FDC_YFGL").html(getValueInfo(res["CL_FDC_YFGL"] )); $("#CL_FDC_XNSS").html(getValueInfo(res["CL_FDC_XNSS"] )); $("#CL_FDC_FDL").html(getValueInfo(res["CL_FDC_RFDL"] )); $("#CL_FDC_GL1").html(getValueInfo(res["CL_FDC_GL"] )); $("#CL_FDC_JRTS").html(getValueToInt(res["CL_FDC_JRTS"] )); $("#CL_FDC_YXTS").html(getValueToInt(res["CL_FDC_YXTS"] )); $("#CL_FDC_GZTS").html(getValueToInt(res["CL_FDC_GZTS"] )); $("#CL_FDC_XDTS").html(getValueToInt(res["CL_FDC_XDTS"] )); $("#CL_FDC_DJTS").html(getValueToInt(res["CL_FDC_DJTS"] )); $("#CL_FDC_WHTS").html(getValueToInt(res["CL_FDC_WHTS"] )); $("#CL_FDC_LXTS").html(getValueToInt(res["CL_FDC_LXTS"] )); $("#DX_FDC_RFDL").html(getValueInfo(res["DX_FDC_RFDL"] )); $("#DX_FDC_LLFDL").html(getValueInfo(res["DX_FDC_LLFDL"] )); $("#DX_FDC_RSWDL").html(getValueInfo(res["DX_FDC_RSWDL"] )); $("#DX_FDC_SCADAFDL").html(getValueInfo(res["DX_FDC_SCADAFDL"] )); //$("#DX_FDC_YLYXS").html(getValueInfo(res["DX_FDC_YLYXS"] )); if(parseFloat(res["DX_FDC_FNLYL"])<80){ $("#DX_FDC_YLYXS").attr("style","color:red"); } $("#DX_FDC_YLYXS").html(getValueInfo(res["DX_FDC_FNLYL"] )); $("#DX_FDC_WHSS").html(getValueInfo(res["DX_FDC_WHSS"] )); $("#DX_FDC_FS").html(getValueInfo(res["DX_FDC_FS"] )); $("#DX_FDC_GZSS").html(getValueInfo(res["DX_FDC_GZSS"] )); $("#DX_FDC_GL").html(getValueInfo(res["DX_FDC_GL"] )); $("#DX_FDC_XDSS").html(getValueInfo(res["DX_FDC_XDSS"] )); $("#DX_FDC_LLGL").html(getValueInfo(res["DX_FDC_LLGL"] )); $("#DX_FDC_SLSS").html(getValueInfo(res["DX_FDC_SLSS"] )); $("#DX_FDC_YFGL").html(getValueInfo(res["DX_FDC_YFGL"] )); $("#DX_FDC_XNSS").html(getValueInfo(res["DX_FDC_XNSS"] )); $("#DX_FDC_FDL").html(getValueInfo(res["DX_FDC_RFDL"] )); $("#DX_FDC_GL1").html(getValueInfo(res["DX_FDC_GL"] )); $("#DX_FDC_JRTS").html(getValueToInt(res["DX_FDC_JRTS"] )); $("#DX_FDC_YXTS").html(getValueToInt(res["DX_FDC_YXTS"] )); $("#DX_FDC_GZTS").html(getValueToInt(res["DX_FDC_GZTS"] )); $("#DX_FDC_XDTS").html(getValueToInt(res["DX_FDC_XDTS"] )); $("#DX_FDC_DJTS").html(getValueToInt(res["DX_FDC_DJTS"] )); $("#DX_FDC_WHTS").html(getValueToInt(res["DX_FDC_WHTS"] )); $("#DX_FDC_LXTS").html(getValueToInt(res["DX_FDC_LXTS"] )); $("#KB_FDC_RFDL").html(getValueInfo(res["KB_FDC_RFDL"] )); $("#KB_FDC_LLFDL").html(getValueInfo(res["KB_FDC_LLFDL"] )); $("#KB_FDC_RSWDL").html(getValueInfo(res["KB_FDC_RSWDL"] )); $("#KB_FDC_SCADAFDL").html(getValueInfo(res["KB_FDC_SCADAFDL"] )); //$("#KB_FDC_YLYXS").html(getValueInfo(res["KB_FDC_YLYXS"] )); if(parseFloat(res["KB_FDC_FNLYL"])<80){ $("#KB_FDC_YLYXS").attr("style","color:red"); } $("#KB_FDC_YLYXS").html(getValueInfo(res["KB_FDC_FNLYL"] )); $("#KB_FDC_WHSS").html(getValueInfo(res["KB_FDC_WHSS"] )); $("#KB_FDC_FS").html(getValueInfo(res["KB_FDC_FS"] )); $("#KB_FDC_GZSS").html(getValueInfo(res["KB_FDC_GZSS"] )); $("#KB_FDC_GL").html(getValueInfo(res["KB_FDC_GL"] )); $("#KB_FDC_XDSS").html(getValueInfo(res["KB_FDC_XDSS"] )); $("#KB_FDC_LLGL").html(getValueInfo(res["KB_FDC_LLGL"] )); $("#KB_FDC_SLSS").html(getValueInfo(res["KB_FDC_SLSS"] )); $("#KB_FDC_YFGL").html(getValueInfo(res["KB_FDC_YFGL"] )); $("#KB_FDC_XNSS").html(getValueInfo(res["KB_FDC_XNSS"] )); $("#KB_FDC_FDL").html(getValueInfo(res["KB_FDC_RFDL"] )); $("#KB_FDC_GL1").html(getValueInfo(res["KB_FDC_GL"] )); $("#KB_FDC_JRTS").html(getValueToInt(res["KB_FDC_JRTS"] )); $("#KB_FDC_YXTS").html(getValueToInt(res["KB_FDC_YXTS"] )); $("#KB_FDC_GZTS").html(getValueToInt(res["KB_FDC_GZTS"] )); $("#KB_FDC_XDTS").html(getValueToInt(res["KB_FDC_XDTS"] )); $("#KB_FDC_DJTS").html(getValueToInt(res["KB_FDC_DJTS"] )); $("#KB_FDC_WHTS").html(getValueToInt(res["KB_FDC_WHTS"] )); $("#KB_FDC_LXTS").html(getValueToInt(res["KB_FDC_LXTS"] )); /********************************************************************************************************/ $("#QYGS_RFDL").html(getValueInfo(res["QYGS_RFDL"] )); $("#QYGS_LLFDL").html(getValueInfo(res["QYGS_LLFDL"] )); $("#QYGS_RSWDL").html(getValueInfo(res["QYGS_RSWDL"] )); $("#QYGS_SCADAFDL").html(getValueInfo(res["QYGS_SCADAFDL"] )); //$("#QYGS_YLYXS").html(getValueInfo(res["QYGS_YLYXS"] )); if(parseFloat(res["QYGS_FNLYL"])<80){ $("#QYGS_YLYXS").attr("style","color:red"); } $("#QYGS_YLYXS").html(getValueInfo(res["QYGS_FNLYL"] )); $("#QYGS_WHSS").html(getValueInfo(res["QYGS_WHSS"] )); $("#QYGS_FS").html(getValueInfo(res["QYGS_FS"] )); $("#QYGS_GZSS").html(getValueInfo(res["QYGS_GZSS"] )); $("#QYGS_GL").html(getValueInfo(res["QYGS_GL"] )); $("#QYGS_XDSS").html(getValueInfo(res["QYGS_XDSS"] )); $("#QYGS_LLGL").html(getValueInfo(res["QYGS_LLGL"] )); $("#QYGS_SLSS").html(getValueInfo(res["QYGS_SLSS"] )); $("#QYGS_YFGL").html(getValueInfo(res["QYGS_YFGL"] )); $("#QYGS_XNSS").html(getValueInfo(res["QYGS_XNSS"] )); //$("#CL_FDC_FS1").html(); //$("#DX_FDC_FS1").html(); //$("#KB_FDC_FS1").html(); var clfs = []; var kbfs = []; var dxfs = []; clfs.push( parseFloat(res["CL_FDC_FS"] )); kbfs.push(parseFloat(res["KB_FDC_FS"] )); dxfs.push(parseFloat(res["DX_FDC_FS"] )); options6.series[0].data = clfs; options7.series[0].data = kbfs; options8.series[0].data = dxfs; chart6 = new Highcharts.Chart(options6); chart7 = new Highcharts.Chart(options7); chart8 = new Highcharts.Chart(options8); /********************************************************************************************************/ } }); } function goaction(wpId) { $("#f1").attr("action","/wpmonitor/zmindex.action?wpId="+wpId).submit(); }