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 type='<s:property value="type"/>';
- var windturbineid='<s:property value="windturbineid"/>';
- var beginDate='<s:property value="beginDate"/>';
- var endDate='<s:property value="endDate"/>';
- var url="querywarningStatisticalWtColumn.action?windturbineid="+windturbineid+"&beginDate="+beginDate+"&endDate="+endDate+"&type="+type;
-
- $.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);
-
- }
- }
- showChart(xaixs,cc,gc,bc);
- },
- 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: {
- rotation: -45,
- 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',
- data: cc,
- tooltip: {
- valueSuffix: ' 次'
- }
-
- }]
-
- });
- }
- </script>
- </head>
- <body>
- <div id="container" style=" height: 400px"></div>
- </body>
|