task4ProjectRptDemo.jsp 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <%@include file="/context/mytags.jsp"%>
  4. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  5. <html>
  6. <head>
  7. <meta charset="UTF-8">
  8. <title>Demo</title>
  9. <!-- 引入echarts文件 -->
  10. <script src="plug-in/echarts/echarts.js"></script>
  11. <%-- <script src="plug-in/jquery-1.7.2.js"></script> --%>
  12. </head>
  13. <body>
  14. <!-- 为ECharts准备一个具备大小(宽高)的Dom -->
  15. <div id="downBtn" style="display: none;">
  16. <span
  17. style="display: -moz-inline-box; display: inline-block; float: right;">
  18. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-return"
  19. onclick="goBefore()" id="back"> <span>返回</span>
  20. </a>
  21. </span>
  22. </div>
  23. <div id="downBtn2" style="display: none;">
  24. <span
  25. style="display: -moz-inline-box; display: inline-block; float: right;">
  26. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-return"
  27. onclick="goBefore2()" id="back2"> <span>返回</span>
  28. </a>
  29. </span>
  30. </div>
  31. <div id="main" style="width: 90%; height: 60%;"></div>
  32. <div id="chart2" style="width: 90%; height: 100%;" style="display: none;"></div>
  33. <div id="chart3" style="width: 90%; height: 60%;" style="display: none;"></div>
  34. <script type="text/javascript">
  35. // alert("1.准备初始化echarts实例");
  36. // 基于准备好的dom,初始化echarts实例
  37. var myChart = echarts.init(document.getElementById('main'));
  38. var myChart2 = echarts.init(document.getElementById('chart2'));
  39. var myChart3 = echarts.init(document.getElementById('chart3'));
  40. var option = {
  41. title : {
  42. text: '项目工作完成情况统计表',
  43. subtext: '技术支持:上海鼎善信息科技有限公司',
  44. x: 'center'
  45. },
  46. tooltip: {
  47. trigger: 'item',
  48. formatter: "{a} <br/>{b}: {c} ({d}%)"
  49. },
  50. legend: {
  51. orient: 'vertical',
  52. x: 'left',
  53. data:['未执行','执行中','已完成','已关闭','已评价']
  54. },
  55. series: [
  56. {
  57. name:'工作完成情况',
  58. type:'pie',
  59. selectedMode: 'single',
  60. radius: [0, '30%'],
  61. label: {
  62. normal: {
  63. position: 'inner'
  64. }
  65. },
  66. labelLine: {
  67. normal: {
  68. show: false
  69. }
  70. },
  71. data:[
  72. {value:335, name:'未完成', selected:true},
  73. {value:679, name:'已完成'},
  74. {value:1548, name:'已评价'}
  75. ]
  76. },
  77. {
  78. name:'工作完成情况',
  79. type:'pie',
  80. radius: ['40%', '55%'],
  81. label: {
  82. normal: {
  83. formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}:}{c} {per|{d}%} ',
  84. backgroundColor: '#eee',
  85. borderColor: '#aaa',
  86. borderWidth: 1,
  87. borderRadius: 4,
  88. // shadowBlur:3,
  89. // shadowOffsetX: 2,
  90. // shadowOffsetY: 2,
  91. // shadowColor: '#999',
  92. // padding: [0, 7],
  93. rich: {
  94. a: {
  95. color: '#999',
  96. lineHeight: 22,
  97. align: 'center'
  98. },
  99. // abg: {
  100. // backgroundColor: '#333',
  101. // width: '100%',
  102. // align: 'right',
  103. // height: 22,
  104. // borderRadius: [4, 4, 0, 0]
  105. // },
  106. hr: {
  107. borderColor: '#aaa',
  108. width: '100%',
  109. borderWidth: 0.5,
  110. height: 0
  111. },
  112. b: {
  113. fontSize: 16,
  114. lineHeight: 33
  115. },
  116. per: {
  117. color: '#eee',
  118. backgroundColor: '#334455',
  119. padding: [2, 4],
  120. borderRadius: 2
  121. }
  122. }
  123. }
  124. },
  125. data:[
  126. {value:120, name:'未执行'},
  127. {value:215, name:'执行中'},
  128. {value:632, name:'已完成'},
  129. {value:47, name:'已关闭'},
  130. {value:1548, name:'已评价'}
  131. ]
  132. }
  133. ]
  134. };
  135. myChart.setOption(option);
  136. myChart.on('click', function (params) {
  137. console.log(params);
  138. /* $("#main").css("display","none"); */
  139. $("#main").hide();
  140. $("#chart2").show();
  141. $("#downBtn").show();
  142. /* $("#downBtn").show();
  143. $("#searchColums").hide();
  144. $("#downcharhead").show();
  145. $("#upcharhead").hide();
  146. $("#upcharhead2").show();
  147. $("#yearspan2").html($("#curYear").val());
  148. $("#downBtn2").hide(); */
  149. initDownCharDate();
  150. })
  151. myChart2.on('click', function (params) {
  152. console.log(params);
  153. /* $("#main").css("display","none"); */
  154. $("#main").hide();
  155. $("#chart2").hide();
  156. $("#chart3").show();
  157. $("#downBtn").hide();
  158. $("#downBtn2").show();
  159. /* $("#downBtn").show();
  160. $("#searchColums").hide();
  161. $("#downcharhead").show();
  162. $("#upcharhead").hide();
  163. $("#upcharhead2").show();
  164. $("#yearspan2").html($("#curYear").val());
  165. $("#downBtn2").hide(); */
  166. initDownCharDate3();
  167. })
  168. function goBefore(){
  169. $("#chart2").hide();
  170. $("#main").show();
  171. $("#downBtn").hide();
  172. myChart.resize();
  173. }
  174. function goBefore2(){
  175. $("#chart3").hide();
  176. $("#chart2").show();
  177. $("#downBtn2").hide();
  178. $("#downBtn").show();
  179. myChart2.resize();
  180. }
  181. // 相当于 document.ready,{代码}
  182. $(function() {
  183. //alert("3.页面加载完毕");
  184. })
  185. function initDownCharDate(){
  186. myChart2.clear();
  187. var option2 ={
  188. title : {
  189. text : '项目工作完成情况统计表-已完成工作统计',
  190. subtext : '技术支持:上海鼎善信息科技有限公司',
  191. x : 'left'
  192. },
  193. tooltip : {
  194. trigger: 'axis',
  195. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  196. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  197. }
  198. },
  199. legend: {
  200. data: ['已完成', '已关闭'],
  201. x: 'right',
  202. },
  203. grid: {
  204. left: '3%',
  205. right: '4%',
  206. bottom: '10%',
  207. containLabel: true
  208. },
  209. xAxis: {
  210. type: 'value'
  211. },
  212. yAxis: {
  213. type: 'category',
  214. data: ['嘉定新图','工业园区','市环境中心','检察院','大众工业学校','交大附中','群艺馆','中小企业','浦阳阁','行政服务中心',
  215. '特保大队','民防','科创','青东法庭','新城','规土','行政窗口','就促','考培','建交委']
  216. },
  217. series: [
  218. {
  219. name: '已完成',
  220. type: 'bar',
  221. stack: '总量',
  222. label: {
  223. normal: {
  224. show: true,
  225. position: 'insideRight'
  226. }
  227. },
  228. data: [24, 52,34,42, 12, 21, 12, 24, 32, 42, 12, 23, 13, 42,36, 24,34, 28, 17, 18 ]
  229. },
  230. {
  231. name: '已关闭',
  232. type: 'bar',
  233. stack: '总量',
  234. label: {
  235. normal: {
  236. show: true,
  237. position: 'insideRight'
  238. }
  239. },
  240. data: [2, 1, 0, 3, 2, 5, 2, 2, 0, 1, 1, 2, 3, 2, 4, 1, 2, 0 , 1 , 1]
  241. }
  242. ]
  243. };
  244. myChart2.setOption(option2);
  245. myChart2.resize();
  246. }
  247. function initDownCharDate3(){
  248. myChart3.clear();
  249. var option3 ={
  250. title : {
  251. text : '工业园区工作完成情况统计表-已完成工作统计',
  252. subtext : '技术支持:上海鼎善信息科技有限公司',
  253. x : 'left'
  254. },
  255. tooltip : {
  256. trigger: 'axis',
  257. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  258. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  259. }
  260. },
  261. legend: {
  262. data: ['已完成', '已关闭'],
  263. x: 'right',
  264. },
  265. grid: {
  266. left: '3%',
  267. right: '4%',
  268. bottom: '10%',
  269. containLabel: true
  270. },
  271. xAxis: {
  272. type: 'value'
  273. },
  274. yAxis: {
  275. type: 'category',
  276. data: ['付小兵','杨益兵','张立科','黄兴才','颜荣']
  277. },
  278. series: [
  279. {
  280. name: '已完成',
  281. type: 'bar',
  282. stack: '总量',
  283. label: {
  284. normal: {
  285. show: true,
  286. position: 'insideRight'
  287. }
  288. },
  289. data: [18, 12, 10, 8, 4 ]
  290. },
  291. {
  292. name: '已关闭',
  293. type: 'bar',
  294. stack: '总量',
  295. label: {
  296. normal: {
  297. show: true,
  298. position: 'insideRight'
  299. }
  300. },
  301. data: [ 1, 0, 0, 0, 0]
  302. }
  303. ]
  304. };
  305. myChart3.setOption(option3);
  306. myChart3.resize();
  307. }
  308. </script>
  309. </body>
  310. </html>