var chart1;
var chart2;
var chart3;
var chart4;
var chart5;
var options1;
var options2;
var options3;
var options4;
var options5;
Highcharts.setOptions({
global : {
useUTC : false
}
});
String.prototype.endWith=function(oString){
var reg=new RegExp(oString+"$");
return reg.test(this);
}
function windtowerAjax() {
var wpid=$("#wpid").val();
$.ajax({
url : "windtowerAjax.action?windfarm="+wpid ,
type : "post",
cache : false,
dataType : "json",
data : {},
ifModified : false,
success : function(res) {
$("#fs10").html(res["fs10"]);
$("#fs30").html(res["fs30"]);
$("#fs50").html(res["fs50"]);
$("#fs70").html(res["fs70"]);
$("#fs80").html(res["fs80"]);
$("#fx10").html(res["fx10"]);
$("#fx30").html(res["fx30"]);
$("#fx50").html(res["fx50"]);
$("#fx70").html(res["fx70"]);
$("#fx80").html(res["fx80"]);
$("#wd").html(res["wd"]);
$("#sd").html(res["sd"]);
$("#yq").html(res["yq"]);
if(chart3.series[0])
{
var point = chart3.series[0].points[0];
point.update(res["wd"]);
}
if(chart4.series[0])
{
var point = chart4.series[0].points[0];
point.update(res["sd"]);
}
if(chart5.series[0])
{
var point = chart5.series[0].points[0];
point.update(res["yq"]);
}
}
});
}
function daychart() {
var wpid=$("#wpid").val();
var url = "dayfzy.action?windfarm="+wpid ;
$.ajax( {
url : url,
type : "post",
cache : false,
dataType : "json",
data : {},
ifModified : false,
success : function(result) {
var data1 = [];
var jfpl=result.jfpl;
$.each(result.data, function(m, obj) {
if (obj.data1 != null) {
data1.push(parseFloat(obj.data1));
}
});
if(null !=options1.series[0])
{
options1.series[0].data = data1;
}
options1.series[0].name = jfpl;
chart1 = new Highcharts.Chart(options1);
}
});
}
function monthchart() {
var wpid=$("#wpid").val();
var url = "monthfzy.action?windfarm="+wpid ;
$.ajax( {
url : url,
type : "post",
cache : false,
dataType : "json",
data : {},
ifModified : false,
success : function(result) {
var data1 = [];
var jfpl=result.jfpl;
$.each(result.data, function(m, obj) {
if (obj.data1 != null) {
data1.push(parseFloat(obj.data1));
}
});
if(null !=options2.series[0])
{
options2.series[0].data = data1;
}
options2.series[0].name = jfpl;
chart2 = new Highcharts.Chart(options2);
}
});
}
$(document).ready(
function() {
options3 = {
chart: {
renderTo: 'container3',
type: 'solidgauge',
events: {
click: function (event) {
findPJFSDetail();
}
}
},
title: null,
pane: {
center: ['50%', '75%'],
size: '100%',
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,
title: {
y: -10
},
labels: {
y: 0
},
min: -50,
max: 50,
title: {
text: null
}
},
plotOptions: {
solidgauge: {
dataLabels: {
y: 15,
borderWidth: 0,
useHTML: true
}
}
},
credits: {
enabled: false
},
series: [{
name: '温度',
data: [12],
dataLabels: {
format: '
{y}
' +
'温度
'
},
tooltip: {
valueSuffix: ' '
}
}]
};
options4 = {
chart: {
renderTo: 'container4',
type: 'solidgauge',
events: {
click: function (event) {
findBZGLDetail();
}
}
},
title: null,
pane: {
center: ['50%', '75%'],
size: '100%',
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,
title: {
y: -10
},
labels: {
y: 0
},
min: -200,
max: 200,
title: {
text: null
}
},
plotOptions: {
solidgauge: {
dataLabels: {
y: 15,
borderWidth: 0,
useHTML: true
}
}
},
credits: {
enabled: false
},
series: [{
name: '湿度',
data: [12],
dataLabels: {
format: '{y}
' +
'湿度
'
},
tooltip: {
valueSuffix: ' '
}
}]
};
options5 = {
chart: {
renderTo: 'container5',
type: 'solidgauge',
events: {
click: function (event) {
findSJGLDetail();
}
}
},
title: null,
pane: {
center: ['50%', '75%'],
size: '100%',
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,
title: {
y: -10
},
labels: {
y: 0
},
min: 0,
max: 500,
title: {
text: null
}
},
plotOptions: {
solidgauge: {
dataLabels: {
y: 15,
borderWidth: 0,
useHTML: true
}
}
},
credits: {
enabled: false
},
series: [{
name: '气压',
data: [12],
dataLabels: {
format: '{y}
' +
'气压
'
},
tooltip: {
valueSuffix: ' '
}
}]
};
options1 = {
chart: {
renderTo : 'fzy1',
polar: true,
type: 'area'
},
title: {
text: '',
x: 0
},
pane: {
size: '80%'
},
xAxis: {
categories: ['北', '北北东', '北东', '东北东','东', '东南东',
'南东', '南南东', '南','南南西', '南西',
'西南西', '西', '西北西', '北西','北北西'
],
tickmarkPlacement: 'on',
lineWidth: 0
},
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0
},
tooltip: {
shared: true,
pointFormat: ' {point.y:,.0f}
'
},
series: [{
name: 'name1',
data: [],
pointPlacement: 'on'
}]
}
options2 = {
chart: {
renderTo : 'fzy2',
polar: true,
type: 'area'
},
title: {
text: '',
x: 0
},
pane: {
size: '80%'
},
xAxis: {
categories: ['北', '北北东', '北东', '东北东','东', '东南东',
'南东', '南南东', '南','南南西', '南西',
'西南西', '西', '西北西', '北西','北北西'
],
tickmarkPlacement: 'on',
lineWidth: 0
},
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0
},
tooltip: {
shared: true,
pointFormat: ' {point.y:,.0f}
'
},
series: [{
name: 'name1',
data: [],
pointPlacement: 'on'
}]
}
chart1 = new Highcharts.Chart(options1);
chart2 = new Highcharts.Chart(options2);
chart3 = new Highcharts.Chart(options3);
chart4 = new Highcharts.Chart(options4);
chart5 = new Highcharts.Chart(options5);
windtowerAjax();
window.setInterval(windtowerAjax, 60000);
daychart();
monthchart();
window.setInterval(daychart, 60000);
wpAllInfoAjax();
window.setInterval(wpAllInfoAjax, 60000);
});