first commit
This commit is contained in:
159
bin/WebRoot/jsp/material/cutterChartsInfo.jsp
Normal file
159
bin/WebRoot/jsp/material/cutterChartsInfo.jsp
Normal file
@ -0,0 +1,159 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
});
|
||||
$.ajaxSetup({
|
||||
async : false
|
||||
});
|
||||
//同步
|
||||
var mpid ="${mpid}";
|
||||
|
||||
var getyFun = function(mpid) {
|
||||
var datay = $.get(ext.contextPath +"/material/cuttercncinfo/getInfo.do?mpid="+mpid);
|
||||
return parseFloat(datay.responseText);
|
||||
};
|
||||
|
||||
var judgeNameFun = function(text){
|
||||
var str = "";
|
||||
if(text == "CutterAmount")
|
||||
{
|
||||
str = "刀补量";
|
||||
}
|
||||
else if(text == "FirstPieceNo")
|
||||
{
|
||||
str = "首补片数";
|
||||
}
|
||||
else if(text == "FirstAmount")
|
||||
{
|
||||
str = "首补量";
|
||||
}
|
||||
else if(text == "AutoFreq")
|
||||
{
|
||||
str = "自补频率";
|
||||
}
|
||||
else if(text == "AutoAmount")
|
||||
{
|
||||
str = "自补量";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<div id="container" style="float:left;width: 350px; height: 300px; margin: 0 auto"></div>
|
||||
<script language="JavaScript">
|
||||
$(document).ready(function() {
|
||||
var chart = {
|
||||
type: 'spline',
|
||||
animation: Highcharts.svg, // don't animate in IE < IE 10.
|
||||
marginRight: 10,
|
||||
events: {
|
||||
load: function () {
|
||||
// set up the updating of the chart each second
|
||||
var series = this.series[0];
|
||||
setInterval(function () {
|
||||
//getJson 位置
|
||||
var x = (new Date()).getTime(), // current time
|
||||
y = getyFun(mpid);//getyFun()
|
||||
series.addPoint([x, y], true, true);
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
};
|
||||
var title = {
|
||||
text: judgeNameFun('${text}')
|
||||
};
|
||||
var xAxis = {
|
||||
type: 'datetime',
|
||||
tickPixelInterval: 150
|
||||
};
|
||||
var yAxis = {
|
||||
title: {
|
||||
text: 'Value'
|
||||
},
|
||||
plotLines: [{
|
||||
value: 0,
|
||||
width: 1,
|
||||
color: '#808080'
|
||||
}]
|
||||
};
|
||||
var tooltip = {
|
||||
formatter: function () {
|
||||
return '<b>' + this.series.name + '</b><br/>' +
|
||||
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
|
||||
Highcharts.numberFormat(this.y, 2);
|
||||
}
|
||||
};
|
||||
var plotOptions = {
|
||||
area: {
|
||||
pointStart: 1940,
|
||||
marker: {
|
||||
enabled: false,
|
||||
symbol: 'circle',
|
||||
radius: 2,
|
||||
states: {
|
||||
hover: {
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
var legend = {
|
||||
enabled: false
|
||||
};
|
||||
var credits = {
|
||||
enabled: false
|
||||
};
|
||||
var exporting = {
|
||||
enabled: false
|
||||
};
|
||||
//图表初值
|
||||
var series= [{
|
||||
name: 'Random data',
|
||||
data: (function () {
|
||||
// generate an array of random data
|
||||
var data = [],time = (new Date()).getTime(),i;
|
||||
for (i = -19; i <= 0; i += 1) {
|
||||
data.push({
|
||||
x: time + i * 1000,
|
||||
y: getyFun(mpid)//getyFun(equid,mpid);
|
||||
});
|
||||
}
|
||||
return data;
|
||||
}())
|
||||
}];
|
||||
|
||||
var json = {};
|
||||
json.chart = chart;
|
||||
json.title = title;
|
||||
json.tooltip = tooltip;
|
||||
json.xAxis = xAxis;
|
||||
json.yAxis = yAxis;
|
||||
json.legend = legend;
|
||||
json.credits = credits;
|
||||
json.exporting = exporting;
|
||||
json.series = series;
|
||||
json.plotOptions = plotOptions;
|
||||
|
||||
|
||||
Highcharts.setOptions({
|
||||
global: {
|
||||
useUTC: false
|
||||
}
|
||||
});
|
||||
$('#container').highcharts(json);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user