123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
- <%@include file="/pages/includes/taglibs.jsp" %>
- <%
- String contextPath = request.getContextPath();
- %>
- <head>
- <script src="<%=contextPath %>/resource/js/jquery.min.js" type="text/javascript"></script>
- <script src="<%=contextPath %>/resource/js/highcharts/highcharts.js" type="text/javascript"></script>
- <script type="text/javascript">
-
- var chart;
-
- $(document).ready(function($){
-
- var wfid='<s:property value="wfId"/>';
- var beginDate='<s:property value="beginDate"/>';
- var endDate='<s:property value="endDate"/>';
- var url="querywarningStatisticalColumn.action?wfId="+wfid+"&beginDate="+beginDate+"&endDate="+endDate;
-
- $.ajax({
- type:"post",
- url:url,
- dataType:"json",
- success:function(data){
-
- if(data.length!=0){
- eval(data);
- var xaixs=[];
- var cc=[];
- var gc=[];
- var bc=[];
- var sc=[];
- var ic=[];
- for(var i=0;i<data.length;i+=1){
-
- var jsonObj1=[data[i].name];
- var obj2=[data[i].frequency];
- var obj3=[data[i].totalhours];
- xaixs.push(jsonObj1);
- cc.push(obj2);
- gc.push(obj3);
- }
- }
- showChart(xaixs,cc,gc,bc,sc);
- },
- error:function(er){
- alert("error1");
- alert(er);
- },
- exception:function(ex){
- //alert(ex);
- }
- });
- });
-
-
-
-
-
-
- function showChart(xc,cc,gc,bc) {
-
- chart=new Highcharts.Chart({
- chart: {
- renderTo:'container',
- zoomType: 'xy'
- },
- title: {
- text: '报警数据统计分析'
- },
-
- xAxis: [{
- categories: xc,
- labels: {
-
- align: 'right',
- style: {
- fontSize: '13px',
- fontFamily: 'Verdana, sans-serif'
- }
- }
- }],
- yAxis: [{ // Primary yAxis
- labels: {
- format: '{value}次',
- style: {
- color: '#4572A7'
- }
- },
- title: {
- text: '频率',
- style: {
- color: '#4572A7'
- }
- }
- }],
- tooltip: {
- shared: true
- },
-
- series: [{
- name: '报警频率',
- color: '#4572A7',
- type: 'column',
- yAxis: 0,
- data: cc,
- tooltip: {
- valueSuffix: ' 次'
- }
-
- }]
-
- });
- }
- </script>
- </head>
- <body>
- <div id="container" style=" height: 400px"></div>
- </body>
|