123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
- <%@include file="/pages/includes/taglibs.jsp" %>
- <%
- String contextPath = request.getContextPath();
- %>
- <head>
- <script src="<%=request.getContextPath()%>/resource/js/highcharts/highcharts.src.js" type="text/javascript"></script>
- <script src="<%=request.getContextPath()%>/resource/js/highcharts/highcharts-more.js"> </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="querywarningStatisticalPie.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,data[i].totalhours];
-
- xaixs.push(jsonObj1);
-
- }
- }
- showChart(xaixs);
- },
- error:function(er){
- alert("error2");
- alert(er);
- },
- exception:function(ex){
- //alert(ex);
- }
- });
- });
-
-
-
-
-
-
- function showChart(xc) {
-
- chart=new Highcharts.Chart({
- chart: {
- renderTo:'container',
-
- plotBackgroundColor: null,
- plotBorderWidth: null,
- plotShadow: false
- },
- title: {
- text: '报警频率统计分析'
- },
- tooltip: {
- pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
- },
- plotOptions: {
- pie: {
- allowPointSelect: true,
- cursor: 'pointer',
- dataLabels: {
- enabled: false,
- color: '#000000',
- connectorColor: '#000000',
- format: '<b>{point.name}</b>: {point.percentage:.1f} %'
- },
- showInLegend: true
-
-
- }
- },
- legend: {
- layout: 'vertical',
- align: 'right',
- verticalAlign: 'middle',
- borderWidth: 0
- },
-
-
- series: [{
- type: 'pie',
- name: '比率',
- data: xc
- }]
-
- });
- }
- </script>
- </head>
- <body>
- <div id="container" style=" height: 400px"></div>
- </body>
|