task4managerRptDemo.jsp 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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 class="btndiv">
  16. <div id="downBtn" style="display: none;">
  17. <span
  18. style="display: -moz-inline-box; display: inline-block; float: right;">
  19. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-return"
  20. onclick="goBefore()" id="back"> <span>返回</span>
  21. </a>
  22. </span>
  23. </div>
  24. <div id="downBtn2" style="display: none;">
  25. <span
  26. style="display: -moz-inline-box; display: inline-block; float: right;">
  27. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-return"
  28. onclick="goBefore2()" id="back2"> <span>返回</span>
  29. </a>
  30. </span>
  31. </div>
  32. </div>
  33. <div id="main" style="width: 90%; height: 60%;"></div>
  34. <div id="chart2" style="width: 90%; height: 100%;" style="display: none;"></div>
  35. <div id="chart3" style="width: 90%; height: 60%;" style="display: none;"></div>
  36. <script type="text/javascript">
  37. // alert("1.准备初始化echarts实例");
  38. // 基于准备好的dom,初始化echarts实例
  39. var myChart = echarts.init(document.getElementById('main'));
  40. var myChart2 = echarts.init(document.getElementById('chart2'));
  41. var myChart3 = echarts.init(document.getElementById('chart3'));
  42. var option = {
  43. title : {
  44. text: '职能部门完成情况统计表',
  45. subtext: '技术支持:上海鼎善信息科技有限公司',
  46. x: 'center'
  47. },
  48. tooltip: {
  49. trigger: 'item',
  50. formatter: "{a} <br/>{b}: {c} ({d}%)"
  51. },
  52. legend: {
  53. orient: 'vertical',
  54. x: 'left',
  55. data:['未执行','执行中','已完成','已关闭','已评价']
  56. },
  57. series: [
  58. {
  59. name:'工作完成情况',
  60. type:'pie',
  61. selectedMode: 'single',
  62. radius: [0, '30%'],
  63. label: {
  64. normal: {
  65. position: 'inner'
  66. }
  67. },
  68. labelLine: {
  69. normal: {
  70. show: false
  71. }
  72. },
  73. data:[
  74. {value:36, name:'未完成', selected:true},
  75. {value:74, name:'已完成'},
  76. {value:78, name:'已评价'}
  77. ]
  78. },
  79. {
  80. name:'工作完成情况',
  81. type:'pie',
  82. radius: ['40%', '55%'],
  83. label: {
  84. normal: {
  85. formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}:}{c} {per|{d}%} ',
  86. backgroundColor: '#eee',
  87. borderColor: '#aaa',
  88. borderWidth: 1,
  89. borderRadius: 4,
  90. // shadowBlur:3,
  91. // shadowOffsetX: 2,
  92. // shadowOffsetY: 2,
  93. // shadowColor: '#999',
  94. // padding: [0, 7],
  95. rich: {
  96. a: {
  97. color: '#999',
  98. lineHeight: 22,
  99. align: 'center'
  100. },
  101. // abg: {
  102. // backgroundColor: '#333',
  103. // width: '100%',
  104. // align: 'right',
  105. // height: 22,
  106. // borderRadius: [4, 4, 0, 0]
  107. // },
  108. hr: {
  109. borderColor: '#aaa',
  110. width: '100%',
  111. borderWidth: 0.5,
  112. height: 0
  113. },
  114. b: {
  115. fontSize: 16,
  116. lineHeight: 33
  117. },
  118. per: {
  119. color: '#eee',
  120. backgroundColor: '#334455',
  121. padding: [2, 4],
  122. borderRadius: 2
  123. }
  124. }
  125. }
  126. },
  127. data:[
  128. {value:12, name:'未执行'},
  129. {value:24, name:'执行中'},
  130. {value:58, name:'已完成'},
  131. {value:16, name:'已关闭'},
  132. {value:78, name:'已评价'}
  133. ]
  134. }
  135. ]
  136. };
  137. myChart.setOption(option);
  138. myChart.on('click', function (params) {
  139. console.log(params);
  140. /* $("#main").css("display","none"); */
  141. $("#main").hide();
  142. $("#chart2").show();
  143. $("#downBtn").show();
  144. /* $("#downBtn").show();
  145. $("#searchColums").hide();
  146. $("#downcharhead").show();
  147. $("#upcharhead").hide();
  148. $("#upcharhead2").show();
  149. $("#yearspan2").html($("#curYear").val());
  150. $("#downBtn2").hide(); */
  151. initDownCharDate();
  152. })
  153. myChart2.on('click', function (params) {
  154. console.log(params);
  155. /* $("#main").css("display","none"); */
  156. $("#main").hide();
  157. $("#chart2").hide();
  158. $("#chart3").show();
  159. $("#downBtn").hide();
  160. $("#downBtn2").show();
  161. /* $("#downBtn").show();
  162. $("#searchColums").hide();
  163. $("#downcharhead").show();
  164. $("#upcharhead").hide();
  165. $("#upcharhead2").show();
  166. $("#yearspan2").html($("#curYear").val());
  167. $("#downBtn2").hide(); */
  168. initDownCharDate3();
  169. })
  170. function goBefore(){
  171. $("#chart2").hide();
  172. $("#main").show();
  173. $("#downBtn").hide();
  174. myChart.resize();
  175. }
  176. function goBefore2(){
  177. $("#chart3").hide();
  178. $("#chart2").show();
  179. $("#downBtn2").hide();
  180. $("#downBtn").show();
  181. myChart2.resize();
  182. }
  183. // 相当于 document.ready,{代码}
  184. $(function() {
  185. //alert("3.页面加载完毕");
  186. })
  187. function initDownCharDate(){
  188. myChart2.clear();
  189. var option2 ={
  190. title : {
  191. text : '职能部门工作完成情况统计表-已完成工作统计',
  192. subtext : '技术支持:上海鼎善信息科技有限公司',
  193. x : 'left'
  194. },
  195. tooltip : {
  196. trigger: 'axis',
  197. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  198. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  199. }
  200. },
  201. legend: {
  202. data: ['已完成', '已关闭'],
  203. x: 'right',
  204. },
  205. grid: {
  206. left: '3%',
  207. right: '4%',
  208. bottom: '10%',
  209. containLabel: true
  210. },
  211. xAxis: {
  212. type: 'value'
  213. },
  214. yAxis: {
  215. type: 'category',
  216. data: ['行政部','总经办','人事部','市场部','财务部','运营部','信息部']
  217. },
  218. series: [
  219. {
  220. name: '已完成',
  221. type: 'bar',
  222. stack: '总量',
  223. label: {
  224. normal: {
  225. show: true,
  226. position: 'insideRight'
  227. }
  228. },
  229. data: [24, 52,34,42, 12, 21, 12 ]
  230. },
  231. {
  232. name: '已关闭',
  233. type: 'bar',
  234. stack: '总量',
  235. label: {
  236. normal: {
  237. show: true,
  238. position: 'insideRight'
  239. }
  240. },
  241. data: [2, 1, 0, 3, 2, 5, 2]
  242. }
  243. ]
  244. };
  245. myChart2.setOption(option2);
  246. myChart2.resize();
  247. }
  248. function initDownCharDate3(){
  249. myChart3.clear();
  250. var option3 ={
  251. title : {
  252. text : '信息部工作完成情况统计表-已完成工作统计',
  253. subtext : '技术支持:上海鼎善信息科技有限公司',
  254. x : 'left'
  255. },
  256. tooltip : {
  257. trigger: 'axis',
  258. axisPointer : { // 坐标轴指示器,坐标轴触发有效
  259. type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
  260. }
  261. },
  262. legend: {
  263. data: ['已完成', '已关闭'],
  264. x: 'right',
  265. },
  266. grid: {
  267. left: '3%',
  268. right: '4%',
  269. bottom: '10%',
  270. containLabel: true
  271. },
  272. xAxis: {
  273. type: 'value'
  274. },
  275. yAxis: {
  276. type: 'category',
  277. data: ['邓超','孙俪','杨颖','周迅','鹿晗']
  278. },
  279. series: [
  280. {
  281. name: '已完成',
  282. type: 'bar',
  283. stack: '总量',
  284. label: {
  285. normal: {
  286. show: true,
  287. position: 'insideRight'
  288. }
  289. },
  290. data: [5, 3, 2, 1, 1 ]
  291. },
  292. {
  293. name: '已关闭',
  294. type: 'bar',
  295. stack: '总量',
  296. label: {
  297. normal: {
  298. show: true,
  299. position: 'insideRight'
  300. }
  301. },
  302. data: [ 1, 0, 1, 0, 0]
  303. }
  304. ]
  305. };
  306. myChart3.setOption(option3);
  307. myChart3.resize();
  308. }
  309. </script>
  310. </body>
  311. </html>