You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
145 lines
2.6 KiB
HTML
145 lines
2.6 KiB
HTML
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<!--<meta charset="utf-8"><link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">-->
|
|
<title>抽水蓄能电站智能化状态监测系统</title>
|
|
|
|
<meta name="viewport" content="with=device-width, initial-scale=1">
|
|
|
|
<style>
|
|
|
|
</style>
|
|
|
|
<script src="https://img.hcharts.cn/jquery/jquery-1.8.3.min.js"></script>
|
|
|
|
<script src="https://img.hcharts.cn/highstock/highstock.js"></script>
|
|
|
|
<script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
|
|
|
|
<script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
|
|
|
|
<!--<script src="https://img.hcharts.cn/highmaps/modules/map.js"></script>-->
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="container" style="min-width:400px;height:400px"></div>
|
|
|
|
<script>
|
|
|
|
$(function () {
|
|
|
|
var alldata=[];
|
|
|
|
$.getJSON('http://www.tp5.com/index/cate2/getjson', function (data) {
|
|
|
|
/* if(data.code !== 1) {
|
|
|
|
alert('读取股票数据失败!');
|
|
|
|
return false;
|
|
|
|
}*/
|
|
|
|
for(i=0;i<data.length;i++){
|
|
|
|
var tm=data[i].d_Time;
|
|
|
|
var ydata=data[i].Q5;
|
|
|
|
var someDate = new Date(Date.parse(tm));
|
|
|
|
var tms=Date.UTC(someDate.getFullYear(), someDate.getMonth(), someDate.getDate(), someDate.getHours(),someDate.getMinutes(),someDate.getSeconds());
|
|
|
|
alldata.push([tms,ydata]);
|
|
|
|
}
|
|
|
|
/*alert(alldata);*/
|
|
|
|
// 去掉多余的数据
|
|
|
|
Highcharts.each(alldata, function(d) {
|
|
|
|
d.length = 2;
|
|
|
|
});
|
|
|
|
Highcharts.stockChart('container', {
|
|
|
|
rangeSelector: {
|
|
|
|
selected: 2
|
|
|
|
},
|
|
|
|
title: {
|
|
|
|
text: '设备温度(℃)曲线图'
|
|
|
|
},
|
|
|
|
plotOptions: {
|
|
|
|
series: {
|
|
|
|
showInLegend: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
tooltip: {
|
|
|
|
split: false,
|
|
|
|
shared: true,
|
|
|
|
|
|
|
|
},
|
|
|
|
yAxis:{
|
|
|
|
labels:{
|
|
|
|
formatter:function(){
|
|
|
|
return this.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
series: [{
|
|
|
|
type: 'area',
|
|
|
|
/*id: '000001',*/
|
|
|
|
name: '温度(℃)',
|
|
|
|
data: alldata,
|
|
|
|
lineWidth: 1
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|