e31860d5621d6c79d3110356c6ba4e76b64efa36.svn-base 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. //定义一组颜色值,可获取相应的样式
  2. var HistohramChartsColor=["#1685a9","#177cb0","#065279","#003472","#4b5cc4","#a1afc9","#2e4e7e",
  3. "#3b2e7e","#4a4266","#426666","#425066","#574266","#8d4bbb","#815463",
  4. "#815476","#4c221b","#003371","#56004f","#801dae","#4c8dae","#b0a4e3"];
  5. /*var HistohramChartsColor=["#383a37","#424647","#4a4041","#3f3534","#3c434b","#626971","#a5aaae",
  6. "#46af91","#ffc631","#ff6742","#ed2b6a","#cd13a5","#735cc6","#b5e4c4",
  7. "#78ce83","#57c27a","#47b657","#3da159","#3e5d3d","#2f573f","#99b9e2"];
  8. var HistohramChartsColor=["#99CC33","#336699","#333300","#3366CC","#99CC33","#333300","#003366",
  9. "#999933","#FF9933","#996600","#993366","#663366","#CCCC33","#CC3366",
  10. "#663366","#996699","#CC9999","#006633","#006633","#669933","#669933"];
  11. var HistohramChartsColor=["#CCCC33","#CC6699","#CC9933","#CC6600","#CC6600","#CC6600","#339999",
  12. "#CC6699","#CC6699","#FF6666","#FF99CC","#CC3399","#FF99CC","#CC3399",
  13. "#CC3399","#FF9999","#996699","#FF33CC","#FF6666","#CC6699","#990066"];*/
  14. //得到当前单位
  15. var Unit="广东电网公司";//(彭志超)
  16. var UnitName=Unit+"应急演练统计";
  17. //类型
  18. var legendHistohramCharts = ["举办次数","参演人数","投入金额","现场综合演练","桌面综合演练","现场专项演练","桌面专项演练"];
  19. //单位
  20. var HistohramUnit=["清远", "江门", "茂名", "韶关", "惠州", "中山", "肇庆", "东莞", "汕尾", "潮州", "阳江", "佛山", "湛江", "汕头", "云浮", "梅州", "河源", "珠海", "揭阳"];
  21. //参数
  22. var HistohramPram= [
  23. {
  24. name:'举办次数',
  25. type:'bar',
  26. data:[18203, 23489, 29034, 104970, 131744, 630230]
  27. },
  28. {
  29. name:'参演人数',
  30. type:'bar',
  31. data:[19325, 23438, 31000, 121594, 134141, 681807]
  32. },
  33. {
  34. name:'投入金额',
  35. type:'bar',
  36. data:[19325, 23438, 31000, 121594, 134141, 681807]
  37. },
  38. {
  39. name:'现场综合演练',
  40. type:'bar',
  41. stack: "综合演练",
  42. data:[19325, 23438, 31000, 121594, 134141, 681807]
  43. },
  44. {
  45. name:'桌面综合演练',
  46. type:'bar',
  47. stack: "综合演练",
  48. data:[19325, 23438, 31000, 121594, 134141, 681807]
  49. },
  50. {
  51. name:'现场专项演练',
  52. type:'bar',
  53. stack: "专项演练",
  54. data:[19325, 23438, 31000, 121594, 134141, 681807]
  55. },
  56. {
  57. name:'桌面专项演练',
  58. type:'bar',
  59. stack: "专项演练",
  60. data:[19325, 23438, 31000, 121594, 134141, 681807]
  61. }
  62. ];
  63. // Step:3 conifg ECharts's path, link to echarts.js from current page.
  64. // Step:3 为模块加载器配置echarts的路径,从当前页面链接到echarts.js,定义所需图表路径
  65. /**
  66. * @author jiangyongfei
  67. * @param 获取地图中所有显示的json
  68. */
  69. function getChildInfo(){
  70. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getAllSum/';
  71. var params = {
  72. deptId : comp_id
  73. };
  74. $.ajax({
  75. url : url,
  76. type : 'post',
  77. timeout : 60000,
  78. data : params,
  79. dataType : 'JSON',
  80. success : function(data){
  81. JSON.stringify(data);
  82. //图例
  83. legendHistohramCharts=JSON.stringify(data.legendHistohramCharts);
  84. //单位
  85. HistohramUnit=JSON.stringify(data.HistohramUnit);
  86. //参数
  87. HistohramPram=JSON.stringify(data.HistohramPram);
  88. for(var i=0;i<5;i++)
  89. {
  90. HistohramPram=HistohramPram.replace("\"{normal: {label:{show: true, position: insideRight}}}\"", "{normal: {label:{show: true, position: \"insideRight\"}}}");
  91. }
  92. HistohramPram=eval('('+ HistohramPram+')');
  93. },
  94. error : function(e){
  95. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  96. }
  97. });
  98. }
  99. function emergencyCommandAndRegulatoryAgency()
  100. {
  101. require.config({
  102. paths: {
  103. echarts: '/nwyj/page/cockpit/tableandmap/js'
  104. }
  105. });
  106. // Step:4 require echarts and use it in the callback.
  107. // Step:4 动态加载echarts然后在回调函数中开始使用,注意保持按需加载结构定义图表路径
  108. require(
  109. [
  110. 'echarts',
  111. 'echarts/chart/bar',
  112. 'echarts/chart/line',
  113. 'echarts/chart/map',
  114. 'echarts/chart/pie',
  115. 'echarts/chart/funnel'
  116. ],
  117. function (ec)
  118. {
  119. option = {
  120. title : {
  121. text:UnitName,
  122. x:'center',
  123. y:"0"
  124. },
  125. tooltip: {
  126. trigger: "item",
  127. axisPointer: {
  128. type: "shadow"
  129. },
  130. show: true,
  131. islandFormatter: "{a} <br>{b} : {c}",
  132. textStyle: {
  133. align: "center",
  134. baseline: "middle"
  135. }
  136. },
  137. toolbox: {
  138. show : true,
  139. y: 'bottom',
  140. feature : {
  141. mark : {show: true},
  142. dataView : {show: true, readOnly: false},
  143. magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
  144. restore : {show: true},
  145. saveAsImage : {show: true}
  146. }
  147. },
  148. calculable : true,
  149. legend: {
  150. y:30,
  151. data:["综合演练","专项演练","现场","桌面","举办次数","参演人数","投入金额"]
  152. },
  153. xAxis : [
  154. {
  155. type : 'category',
  156. splitLine : {show : false},
  157. data : ['举办次数','参演人数','投入金额']
  158. }
  159. ],
  160. yAxis : [
  161. {
  162. type : 'value',
  163. position: 'right'
  164. }
  165. ],
  166. series : [
  167. {
  168. name:'举办次数',
  169. type:'bar',
  170. barMaxWidth:40,
  171. data:[100,"",""]
  172. },
  173. {
  174. name:'参演人数',
  175. type:'bar',
  176. barMaxWidth:40,
  177. tooltip : {trigger: 'item'},
  178. data:["",200,""]
  179. },
  180. {
  181. name:'投入金额',
  182. type:'bar',
  183. barMaxWidth:40,
  184. tooltip : {trigger: 'item'},
  185. data:["","",300]
  186. },
  187. {
  188. name: "按功能演练分",
  189. type: "pie",
  190. tooltip : {
  191. trigger: 'item',
  192. formatter: '{a} <br/>{b} : {c} ({d}%)'
  193. },
  194. center: [160,130],
  195. selectedMode: "single",
  196. radius: [0, 60],
  197. itemStyle: {
  198. normal: {
  199. label: {
  200. position: "inside"
  201. },
  202. labelLine: {
  203. show: false
  204. }
  205. }
  206. },
  207. data: [
  208. {
  209. value: 100,
  210. name: "综合演练"
  211. },
  212. {
  213. value: 280,
  214. name: "专项演练"
  215. }
  216. ]
  217. },
  218. {
  219. name: "演练",
  220. type: "pie",
  221. tooltip : {
  222. trigger: 'item'
  223. },
  224. center: [160,130],
  225. radius: [50, 100],
  226. data: [
  227. {
  228. value: 50,
  229. name: "现场"
  230. },
  231. {
  232. value: 50,
  233. name: "桌面"
  234. },
  235. {
  236. value: 150,
  237. name: "现场"
  238. },
  239. {
  240. value: 130,
  241. name: "桌面"
  242. }
  243. ]
  244. }
  245. ]
  246. };
  247. var myChart = ec.init(document.getElementById('histogram'));
  248. myChart.setOption(option);
  249. window.onresize = myChart.resize;
  250. });
  251. }