detailpiechart.jsp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%@include file="/pages/includes/taglibs.jsp"%>
  3. <head>
  4. <link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/resource/plugin/jqgrid/css/ui.jqgrid.css" />
  5. <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resource/plugin/jqueryui/css/custom-theme/jquery-ui-1.9.2.custom.css" />
  6. <script src="<%=request.getContextPath() %>/resource/js/jquery-1.8.3.js" type="text/javascript"></script>
  7. <script src="<%=request.getContextPath() %>/resource/plugin/jqueryui/js/jquery-ui-1.9.2.custom.js" type="text/javascript"></script>
  8. <script src="<%=request.getContextPath()%>/resource/js/highcharts/highcharts.src.js" type="text/javascript"></script>
  9. <script src="<%=request.getContextPath()%>/resource/js/highcharts/highcharts-more.js"></script>
  10. <script src="<%=request.getContextPath()%>/resource/js/highcharts/modules/solid-gauge.src.js"></script>
  11. <script src="<%=request.getContextPath()%>/resource/js/datePicker/WdatePicker.js" type="text/javascript"></script>
  12. <script type="text/javascript">
  13. var chart1;
  14. var chart2;
  15. var chart3;
  16. var chart4;
  17. var chart5;
  18. var chart6;
  19. var options1;
  20. var options2;
  21. var options3;
  22. var options4;
  23. var options5;
  24. var options6;
  25. $(function() {
  26. var wf = '<s:property value="windfarm"/>';
  27. var wt = '<s:property value="windturbineid"/>';
  28. var rd = '<s:property value="recorddate"/>';
  29. changeFc(wf, wt);
  30. /***************************************************************************************************/
  31. options1 = {
  32. chart : {
  33. renderTo : 'rqr',
  34. height:300,width:480,
  35. plotBackgroundColor : null,
  36. plotBorderWidth : null,
  37. plotShadow : false
  38. },
  39. title : {
  40. text : '日切入频率分析'
  41. },
  42. tooltip : {
  43. pointFormat : '{series.name}: <b>{point.percentage:.1f}%</b>'
  44. },
  45. plotOptions : {
  46. pie : {
  47. allowPointSelect : true,
  48. cursor : 'pointer',
  49. dataLabels : {
  50. enabled : false,
  51. color : '#000000',
  52. connectorColor : '#000000',
  53. format : '<b>{point.name}</b>: {point.percentage:.1f} %'
  54. },
  55. showInLegend : true
  56. }
  57. },
  58. legend : {
  59. layout : 'vertical',
  60. align : 'right',
  61. verticalAlign : 'middle',
  62. borderWidth : 0
  63. },
  64. series : [ {
  65. type : 'pie',
  66. name : '频率',
  67. data : []
  68. } ]
  69. }
  70. /***************************************************************************************************/
  71. options2 = {
  72. chart : {
  73. renderTo : 'yqr',
  74. height:300,width:480,
  75. plotBackgroundColor : null,
  76. plotBorderWidth : null,
  77. plotShadow : false
  78. },
  79. title : {
  80. text : '月切入频率分析'
  81. },
  82. tooltip : {
  83. pointFormat : '{series.name}: <b>{point.percentage:.1f}%</b>'
  84. },
  85. plotOptions : {
  86. pie : {
  87. allowPointSelect : true,
  88. cursor : 'pointer',
  89. dataLabels : {
  90. enabled : false,
  91. color : '#000000',
  92. connectorColor : '#000000',
  93. format : '<b>{point.name}</b>: {point.percentage:.1f} %'
  94. },
  95. showInLegend : true
  96. }
  97. },
  98. legend : {
  99. layout : 'vertical',
  100. align : 'right',
  101. verticalAlign : 'middle',
  102. borderWidth : 0
  103. },
  104. series : [ {
  105. type : 'pie',
  106. name : '频率',
  107. data : []
  108. } ]
  109. }
  110. /***************************************************************************************************/
  111. options3 = {
  112. chart : {
  113. renderTo : 'nqr',
  114. height:300,width:480,
  115. plotBackgroundColor : null,
  116. plotBorderWidth : null,
  117. plotShadow : false
  118. },
  119. title : {
  120. text : '年切入频率分析'
  121. },
  122. tooltip : {
  123. pointFormat : '{series.name}: <b>{point.percentage:.1f}%</b>'
  124. },
  125. plotOptions : {
  126. pie : {
  127. allowPointSelect : true,
  128. cursor : 'pointer',
  129. dataLabels : {
  130. enabled : false,
  131. color : '#000000',
  132. connectorColor : '#000000',
  133. format : '<b>{point.name}</b>: {point.percentage:.1f} %'
  134. },
  135. showInLegend : true
  136. }
  137. },
  138. legend : {
  139. layout : 'vertical',
  140. align : 'right',
  141. verticalAlign : 'middle',
  142. borderWidth : 0
  143. },
  144. series : [ {
  145. type : 'pie',
  146. name : '频率',
  147. data : []
  148. } ]
  149. }
  150. /***************************************************************************************************/
  151. options4 = {
  152. chart : {
  153. renderTo : 'rqc',
  154. height:300,width:480,
  155. plotBackgroundColor : null,
  156. plotBorderWidth : null,
  157. plotShadow : false
  158. },
  159. title : {
  160. text : '日切出频率分析'
  161. },
  162. tooltip : {
  163. pointFormat : '{series.name}: <b>{point.percentage:.1f}%</b>'
  164. },
  165. plotOptions : {
  166. pie : {
  167. allowPointSelect : true,
  168. cursor : 'pointer',
  169. dataLabels : {
  170. enabled : false,
  171. color : '#000000',
  172. connectorColor : '#000000',
  173. format : '<b>{point.name}</b>: {point.percentage:.1f} %'
  174. },
  175. showInLegend : true
  176. }
  177. },
  178. legend : {
  179. layout : 'vertical',
  180. align : 'right',
  181. verticalAlign : 'middle',
  182. borderWidth : 0
  183. },
  184. series : [ {
  185. type : 'pie',
  186. name : '频率',
  187. data : []
  188. } ]
  189. }
  190. /***************************************************************************************************/
  191. options5 = {
  192. chart : {
  193. renderTo : 'yqc',
  194. height:300,width:480,
  195. plotBackgroundColor : null,
  196. plotBorderWidth : null,
  197. plotShadow : false
  198. },
  199. title : {
  200. text : '月切出频率分析'
  201. },
  202. tooltip : {
  203. pointFormat : '{series.name}: <b>{point.percentage:.1f}%</b>'
  204. },
  205. plotOptions : {
  206. pie : {
  207. allowPointSelect : true,
  208. cursor : 'pointer',
  209. dataLabels : {
  210. enabled : false,
  211. color : '#000000',
  212. connectorColor : '#000000',
  213. format : '<b>{point.name}</b>: {point.percentage:.1f} %'
  214. },
  215. showInLegend : true
  216. }
  217. },
  218. legend : {
  219. layout : 'vertical',
  220. align : 'right',
  221. verticalAlign : 'middle',
  222. borderWidth : 0
  223. },
  224. series : [ {
  225. type : 'pie',
  226. name : '频率',
  227. data : []
  228. } ]
  229. }
  230. /***************************************************************************************************/
  231. options6 = {
  232. chart : {
  233. renderTo : 'nqc',
  234. height:300,width:480,
  235. plotBackgroundColor : null,
  236. plotBorderWidth : null,
  237. plotShadow : false
  238. },
  239. title : {
  240. text : '年切出频率分析'
  241. },
  242. tooltip : {
  243. pointFormat : '{series.name}: <b>{point.percentage:.1f}%</b>'
  244. },
  245. plotOptions : {
  246. pie : {
  247. allowPointSelect : true,
  248. cursor : 'pointer',
  249. dataLabels : {
  250. enabled : false,
  251. color : '#000000',
  252. connectorColor : '#000000',
  253. format : '<b>{point.name}</b>: {point.percentage:.1f} %'
  254. },
  255. showInLegend : true
  256. }
  257. },
  258. legend : {
  259. layout : 'vertical',
  260. align : 'right',
  261. verticalAlign : 'middle',
  262. borderWidth : 0
  263. },
  264. series : [ {
  265. type : 'pie',
  266. name : '频率',
  267. data : []
  268. } ]
  269. }
  270. /***************************************************************************************************/
  271. showChart();
  272. })
  273. function changeFc(fcId, fjId) {
  274. var url = "../warn/changeFc.action?fcId=" + fcId;
  275. $
  276. .ajax({
  277. type : "post",
  278. url : url,
  279. dataType : "json",
  280. success : function(data) {
  281. if (data.length != 0) {
  282. eval(data);
  283. $("#windturbineid").empty();
  284. for ( var i = 0; i < data.length; i++) {
  285. $("#windturbineid").append("<option value='"+data[i].id+"'>"+data[i].code+"</option>");
  286. }
  287. $("#windturbineid").val(fjId);
  288. } else {
  289. $("#windturbineid").empty();
  290. }
  291. }
  292. });
  293. }
  294. function queryData() {
  295. var recorddate = $("#recorddate").val();
  296. var windfarm = $("#windfarm").val();
  297. var windturbineid = $("#windturbineid").val();
  298. if ("" == windfarm) {
  299. alert("请选择风场!");
  300. return false;
  301. } else if ("" == windturbineid) {
  302. alert("请选择风机!");
  303. return false;
  304. }
  305. if ("" == recorddate) {
  306. alert("请选择查询日期!");
  307. return false;
  308. }
  309. $("#f1").attr("action", "../wtgoodness/detailpieindex.action").submit();
  310. }
  311. var temp = 0;
  312. function showChart() {
  313. var url1;
  314. var url2;
  315. var url3;
  316. var url4;
  317. var url5;
  318. var url6;
  319. if (temp == 0) {
  320. var windturbineid = '<s:property value="windturbineid"/>';
  321. var recorddate = '<s:property value="recorddate"/>';
  322. url1 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  323. + "&recorddate=" + recorddate + "&type=1";
  324. url2 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  325. + "&recorddate=" + recorddate + "&type=2";
  326. url3 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  327. + "&recorddate=" + recorddate + "&type=3";
  328. url4 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  329. + "&recorddate=" + recorddate + "&type=4";
  330. url5 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  331. + "&recorddate=" + recorddate + "&type=5";
  332. url6 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  333. + "&recorddate=" + recorddate + "&type=6";
  334. temp++;
  335. } else {
  336. var recorddate = $("#recorddate").val();
  337. var windturbineid = $("#windturbineid").val();
  338. url1 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  339. + "&recorddate=" + recorddate + "&type=1";
  340. url2 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  341. + "&recorddate=" + recorddate + "&type=2";
  342. url3 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  343. + "&recorddate=" + recorddate + "&type=3";
  344. url4 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  345. + "&recorddate=" + recorddate + "&type=4";
  346. url5 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  347. + "&recorddate=" + recorddate + "&type=5";
  348. url6 = "../wtgoodness/pieChart.action?windturbineid=" + windturbineid
  349. + "&recorddate=" + recorddate + "&type=6";
  350. }
  351. /***************************************************************************************************/
  352. $.ajax( {
  353. url : url1,
  354. type : "post",
  355. cache : false,
  356. dataType : "json",
  357. data : {},
  358. ifModified : false,
  359. success : function(result) {
  360. if (null!=result && result.length != 0) {
  361. eval(result);
  362. var xaixs = [];
  363. for ( var i = 0; i < result.length; i += 1) {
  364. var jsonObj1 = [ result[i].name, result[i].value2 ];
  365. xaixs.push(jsonObj1);
  366. }
  367. options1.series[0].data = xaixs;
  368. chart1 = new Highcharts.Chart(options1);
  369. }
  370. }
  371. });
  372. /***************************************************************************************************/
  373. $.ajax( {
  374. url : url2,
  375. type : "post",
  376. cache : false,
  377. dataType : "json",
  378. data : {},
  379. ifModified : false,
  380. success : function(result) {
  381. if (null!=result && result.length != 0) {
  382. eval(result);
  383. var xaixs = [];
  384. for ( var i = 0; i < result.length; i += 1) {
  385. var jsonObj1 = [ result[i].name, result[i].value2 ];
  386. xaixs.push(jsonObj1);
  387. }
  388. options2.series[0].data = xaixs;
  389. chart2 = new Highcharts.Chart(options2);
  390. }
  391. }
  392. });
  393. /***************************************************************************************************/
  394. $.ajax( {
  395. url : url3,
  396. type : "post",
  397. cache : false,
  398. dataType : "json",
  399. data : {},
  400. ifModified : false,
  401. success : function(result) {
  402. if (null!=result && result.length != 0) {
  403. eval(result);
  404. var xaixs = [];
  405. for ( var i = 0; i < result.length; i += 1) {
  406. var jsonObj1 = [ result[i].name, result[i].value2 ];
  407. xaixs.push(jsonObj1);
  408. }
  409. options3.series[0].data = xaixs;
  410. chart3 = new Highcharts.Chart(options3);
  411. }
  412. }
  413. });
  414. /***************************************************************************************************/
  415. $.ajax( {
  416. url : url4,
  417. type : "post",
  418. cache : false,
  419. dataType : "json",
  420. data : {},
  421. ifModified : false,
  422. success : function(result) {
  423. if (null!=result && result.length != 0) {
  424. eval(result);
  425. var xaixs = [];
  426. for ( var i = 0; i < result.length; i += 1) {
  427. var jsonObj1 = [ result[i].name, result[i].value2 ];
  428. xaixs.push(jsonObj1);
  429. }
  430. options4.series[0].data = xaixs;
  431. chart4 = new Highcharts.Chart(options4);
  432. }
  433. }
  434. });
  435. /***************************************************************************************************/
  436. $.ajax( {
  437. url : url5,
  438. type : "post",
  439. cache : false,
  440. dataType : "json",
  441. data : {},
  442. ifModified : false,
  443. success : function(result) {
  444. if (null!=result && result.length != 0) {
  445. eval(result);
  446. var xaixs = [];
  447. for ( var i = 0; i < result.length; i += 1) {
  448. var jsonObj1 = [ result[i].name, result[i].value2 ];
  449. xaixs.push(jsonObj1);
  450. }
  451. options5.series[0].data = xaixs;
  452. chart5 = new Highcharts.Chart(options5);
  453. }
  454. }
  455. });
  456. /***************************************************************************************************/
  457. $.ajax( {
  458. url : url6,
  459. type : "post",
  460. cache : false,
  461. dataType : "json",
  462. data : {},
  463. ifModified : false,
  464. success : function(result) {
  465. if (null!=result && result.length != 0) {
  466. eval(result);
  467. var xaixs = [];
  468. for ( var i = 0; i < result.length; i += 1) {
  469. var jsonObj1 = [ result[i].name, result[i].value2 ];
  470. xaixs.push(jsonObj1);
  471. }
  472. options6.series[0].data = xaixs;
  473. chart6 = new Highcharts.Chart(options6);
  474. }
  475. }
  476. });
  477. /***************************************************************************************************/
  478. }
  479. </script>
  480. <body style='overflow: scroll;'>
  481. <form action="" method="get" id="f1">
  482. <table width="1560" border="0" cellspacing="0" cellpadding="0">
  483. <tr>
  484. <td width="50" height="30" bgcolor="#EFF1F0">
  485. &nbsp;
  486. </td>
  487. <td width="1560" bgcolor="#EFF1F0">
  488. <span class="Text"> 风场: <label for="textfield5"></label> <s:if
  489. test="u.wpId == null">
  490. <s:select list="wps" listKey="id" listValue="name" id="windfarm"
  491. name="windfarm" onchange="javascript:changeFc(this.value);"></s:select>
  492. </s:if> <s:else>
  493. <s:select list="wps" listKey="id" listValue="name" id="windfarm"
  494. name="windfarm" onchange="javascript:changeFc(this.value);"></s:select>
  495. </s:else> 风机: <label for="textfield6" width="100"></label> <select
  496. name="windturbineid" id="windturbineid">
  497. <option value="">
  498. 请选择
  499. </option>
  500. </select> 日期: <s:textfield cssClass="Wdate"
  501. onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowWeek:true,readOnly:true})"
  502. id="recorddate" name="recorddate" title="开始日期" /> <input
  503. type="submit" name="button" id="button" onclick="queryData();"
  504. value="查询" />
  505. </td>
  506. </span>
  507. </td>
  508. </tr>
  509. </table>
  510. <table width="1000" border="0" cellspacing="0" cellpadding="0">
  511. <tr>
  512. <td align="center" valign="top">
  513. <table border="0" cellspacing="0" cellpadding="0">
  514. <tr>
  515. <td>
  516. <img
  517. src="<%=request.getContextPath()%>/resource/images/detailInfo/pie1.jpg"
  518. width="500" height="35" />
  519. </td>
  520. </tr>
  521. <tr>
  522. <td>
  523. <div id="rqr"></div>
  524. </td>
  525. </tr>
  526. <tr>
  527. <td></td>
  528. </tr>
  529. </table>
  530. </td>
  531. <td align="center" valign="top">
  532. <table border="0" cellspacing="0" cellpadding="0">
  533. <tr>
  534. <td>
  535. <img
  536. src="<%=request.getContextPath()%>/resource/images/detailInfo/pie2.jpg"
  537. width="500" height="35" />
  538. </td>
  539. </tr>
  540. <tr>
  541. <td>
  542. <div id="yqr"></div>
  543. </td>
  544. </tr>
  545. <tr>
  546. <td></td>
  547. </tr>
  548. </table>
  549. </td>
  550. <td align="center" valign="top">
  551. <table border="0" cellspacing="0" cellpadding="0">
  552. <tr>
  553. <td>
  554. <img
  555. src="<%=request.getContextPath()%>/resource/images/detailInfo/pie3.jpg"
  556. width="500" height="35" />
  557. </td>
  558. </tr>
  559. <tr>
  560. <td>
  561. <div id="nqr"></div>
  562. </td>
  563. </tr>
  564. <tr>
  565. <td></td>
  566. </tr>
  567. </table>
  568. </td>
  569. </tr>
  570. <tr>
  571. <td align="center" valign="top">
  572. <table border="0" cellspacing="0" cellpadding="0">
  573. <tr>
  574. <td>
  575. <img
  576. src="<%=request.getContextPath()%>/resource/images/detailInfo/pie4.jpg"
  577. width="500" height="35" />
  578. </td>
  579. </tr>
  580. <tr>
  581. <td>
  582. <div id="rqc"></div>
  583. </td>
  584. </tr>
  585. <tr>
  586. <td></td>
  587. </tr>
  588. </table>
  589. </td>
  590. <td align="center" valign="top">
  591. <table border="0" cellspacing="0" cellpadding="0">
  592. <tr>
  593. <td>
  594. <img
  595. src="<%=request.getContextPath()%>/resource/images/detailInfo/pie5.jpg"
  596. width="500" height="35" />
  597. </td>
  598. </tr>
  599. <tr>
  600. <td>
  601. <div id="yqc"></div>
  602. </td>
  603. </tr>
  604. <tr>
  605. <td></td>
  606. </tr>
  607. </table>
  608. </td>
  609. <td align="center" valign="top">
  610. <table border="0" cellspacing="0" cellpadding="0">
  611. <tr>
  612. <td>
  613. <img
  614. src="<%=request.getContextPath()%>/resource/images/detailInfo/pie6.jpg"
  615. width="500" height="35" />
  616. </td>
  617. </tr>
  618. <tr>
  619. <td>
  620. <div id="nqc"></div>
  621. </td>
  622. </tr>
  623. <tr>
  624. <td></td>
  625. </tr>
  626. </table>
  627. </td>
  628. </tr>
  629. </table>
  630. </form>
  631. </body>