var chartfc; var chartgf; var optionsfc; var optionsgf; Highcharts.setOptions({ global : { useUTC : false } }); optionsfc = { colors: [ '#19FF38', '#0026FF', '#FF350C' ], chart: { renderTo: 'chartfc', type: 'spline', //backgroundColor:'#BFDFFF', //plotBackgroundColor:'#BFDFFF', zoomType: 'x', events: { } }, title: { text: '风场实时功率' }, subtitle: { text: '' }, xAxis: { labels: { align: 'center', formatter: function() { return Highcharts.dateFormat('%H
%M', this.value); } }, type: 'datetime' }, yAxis: [{ title: { text: '功率(MW)' } }], legend: { layout: 'vertical', // backgroundColor: '#FFFFFF', align: 'left', verticalAlign: 'top', 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); }*/ }, credits: { enabled: false }, plotOptions: { spline: { dataLabels : { enabled :false }, // pointPadding: 0.2, borderWidth: 0 }, column: { pointPadding: 0.2, borderWidth: 0 }, series: { cursor: 'pointer', marker: { radius: 0, symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" } } }, series: [{ name: '预测功率(MW)', yAxis:0 }, { name: '实际功率(MW)', yAxis:0 },{ name: '应发功率(MW)', yAxis:0 }] }; optionsgf = { colors: [ '#19FF38', '#0026FF', '#FF350C' ], chart: { renderTo: 'chartgf', type: 'spline', //backgroundColor:'#BFDFFF', //plotBackgroundColor:'#BFDFFF', zoomType: 'x', events: { } }, title: { text: '电站实时功率' }, subtitle: { text: '' }, xAxis: { labels: { align: 'center', formatter: function() { return Highcharts.dateFormat('%H
%M', this.value); } }, type: 'datetime' }, yAxis: [{ title: { text: '功率(MW)' } }], legend: { layout: 'vertical', // backgroundColor: '#FFFFFF', align: 'left', verticalAlign: 'top', 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); }*/ }, credits: { enabled: false }, plotOptions: { spline: { dataLabels : { enabled :false }, // pointPadding: 0.2, borderWidth: 0 }, column: { pointPadding: 0.2, borderWidth: 0 }, series: { cursor: 'pointer', marker: { radius: 0, symbol: 'circle' //曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle" } } }, series: [{ name: '预测功率(MW)', yAxis:0 }, { name: '实际功率(MW)', yAxis:0 },{ name: '应发功率(MW)', yAxis:0 }] }; $(document).ready( function(){ chartfc=new Highcharts.Chart(optionsfc); chartgf=new Highcharts.Chart(optionsgf); realfc(); realgf(); window.setInterval(realfc,60000); window.setInterval(realgf,80000); } ); function realfc(){ $.ajax({ url : 'realFcAjax.action', type : "post", cache : false, dataType : "json", data : {}, ifModified : false, success : function(result) { var ycgl = []; var sjgl = []; var pjfs = []; var xtime = []; var index=0; var count=0; $.each(result, function(m, obj) { //if(m == result.length -1){ if(index