var chart1; var options1; Highcharts.setOptions({ global : { useUTC : false } }); String.prototype.endWith=function(oString){ var reg=new RegExp(oString+"$"); return reg.test(this); } function wpAllInfoAjax() { $.ajax( { url : "windfarmrealtimeinfo.action?wfName=SBQ_FDC", type : "post", cache : false, dataType : "json", data : {}, ifModified : false, success : function(res) { $("#zjrl").html(res["zjrl"] + ""); $("#zgl").html(res["zgl"] + ""); $("#pjfs").html(res["pjfs"] + ""); $("#rfdl").html(res["rfdl"] + ""); $("#yfdl").html(res["yfdl"] + ""); $("#nfdl").html(res["nfdl"] + ""); $("#yxts").html(res["yxts"] + ""); $("#djts").html(res["djts"] + ""); $("#whts").html(res["whts"] + ""); $("#gzts").html(res["gzts"] + ""); $("#lxts").html(res["lxts"] + ""); $("#xdts").html(res["xdts"] + ""); $("#jrts").html(res["jrts"] + ""); $("#wd").html(res["wd"] + ""); $("#rqfss").html(res["rqfss"] + ""); $("#rgzss").html(res["rgzss"] + ""); $("#rwhss").html(res["rwhss"] + ""); $("#rxdss").html(res["rxdss"] + ""); $("#rslss").html(res["rslss"] + ""); $("#whxs").html(res["whxs"] + ""); $("#gzxs").html(res["gzxs"] + ""); $("#xdxs").html(res["xdxs"] + ""); $("#bjcs").html(res["bjcs"] + ""); $("#gzcs").html(res["gzcs"] + ""); $("#rfdl1").html(res["rfdl1"] + ""); $("#pjfs1").html(res["pjfs1"] + ""); $("#yxts1").html(res["yxts1"] + ""); $("#djts1").html(res["djts1"] + ""); $("#whts1").html(res["whts1"] + ""); $("#gzts1").html(res["gzts1"] + ""); $("#lxts1").html(res["lxts1"] + ""); $("#xdts1").html(res["xdts1"] + ""); $("#jrts1").html(res["jrts1"] + ""); $("#rfdl2").html(res["rfdl2"] + ""); $("#pjfs2").html(res["pjfs2"] + ""); $("#yxts2").html(res["yxts2"] + ""); $("#djts2").html(res["djts2"] + ""); $("#whts2").html(res["whts2"] + ""); $("#gzts2").html(res["gzts2"] + ""); $("#lxts2").html(res["lxts2"] + ""); $("#xdts2").html(res["xdts2"] + ""); $("#jrts2").html(res["jrts2"] + ""); getvalueinfos($("#rfdl3"),res["rfdl3"]); getvalueinfos($("#pjfs3"),res["pjfs3"]); getvalueinfos($("#yxts3"),res["yxts3"]); getvalueinfos($("#djts3"),res["djts3"]); getvalueinfos($("#whts3"),res["whts3"]); getvalueinfos($("#gzts3"),res["gzts3"]); getvalueinfos($("#lxts3"),res["lxts3"]); getvalueinfos($("#xdts3"),res["xdts3"]); getvalueinfos($("#jrts3"),res["jrts3"]); getvalueinfos($("#rfdl4"),res["rfdl4"]); getvalueinfos($("#pjfs4"),res["pjfs4"]); getvalueinfos($("#yxts4"),res["yxts4"]); getvalueinfos($("#djts4"),res["djts4"]); getvalueinfos($("#whts4"),res["whts4"]); getvalueinfos($("#gzts4"),res["gzts4"]); getvalueinfos($("#lxts4"),res["lxts4"]); getvalueinfos($("#xdts4"),res["xdts4"]); getvalueinfos($("#jrts4"),res["jrts4"]); } }); } function getvalueinfos(obj,value) { if(value==undefined) { obj.html(""); }else { obj.html(value + ""); } } options1 = { colors: [ '#00B259', //绿 '#B20000', //红 '#006DD9', //蓝 '#000000', //黑 '#FFBFFF',//藕荷色 '#FF8000'//橘黄 ], chart: { renderTo: 'container1', type: 'spline', //backgroundColor:'#BFDFFF', //plotBackgroundColor:'#BFDFFF', zoomType: 'x', events: { } },title:null , subtitle: { text: '' }, xAxis: { labels: { align: 'center', formatter: function() { return Highcharts.dateFormat('%H
%M', this.value); } }, type: 'datetime' }, yAxis: [{ title: { text: '功率数值(MW)' } },{ title:{ text :'风速/日照强度' }, labels:{ formatter: function(){ return this.value; } }, lineWidth : 1, opposite:true }], legend: { layout: 'vertical', // backgroundColor: '#FFFFFF', align: 'right', verticalAlign: 'top', floating: true // shadow: true // layout: 'vertical', // align: 'right', // verticalAlign: 'middle', // borderWidth: 0 }, tooltip: { crosshairs:{//控制十字线 width:2 }, 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); }*/ }, credits: { enabled: false }, plotOptions: { spline: { dataLabels : { enabled :false }, // pointPadding: 0.2, borderWidth: 0 }, series: { cursor: 'pointer', marker: { radius: 0, symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" } } }, series: [{ type: 'spline', name: '应发功率(单位:MW)', yAxis:0 }, { type: 'spline', name: '实发功率(单位:MW)', yAxis:0 }, { type: 'spline', name: '理论功率(单位:MW)', yAxis:0 }, { type: 'spline', name: '预测功率(单位:MW)', yAxis:0 }, { type: 'spline', name: '保证功率(单位:MW)', yAxis:0 },{ type: 'spline', name: '平均风速/日照强度', yAxis:1 }] }; function apdata(){ var url = "windfarmpower.action?wfName=SBQ_FDC" $.ajax({ url : url, type : "post", cache : false, dataType : "json", data : {}, ifModified : false, success : function(result) { var yfgl = []; var sjgl = []; var lvgl = []; var ycgl = []; var bzgl = []; var pjfs = []; var xtime=[]; var index=0; var count=0; $.each(result, function(m, obj) { //if(m == result.length -1){ if(index