123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- //定义一组颜色值,可获取相应的样式
- var HistohramChartsColor=["#1685a9","#177cb0","#065279","#003472","#4b5cc4","#a1afc9","#2e4e7e",
- "#3b2e7e","#4a4266","#426666","#425066","#574266","#8d4bbb","#815463",
- "#815476","#4c221b","#003371","#56004f","#801dae","#4c8dae","#b0a4e3"];
- /*var HistohramChartsColor=["#383a37","#424647","#4a4041","#3f3534","#3c434b","#626971","#a5aaae",
- "#46af91","#ffc631","#ff6742","#ed2b6a","#cd13a5","#735cc6","#b5e4c4",
- "#78ce83","#57c27a","#47b657","#3da159","#3e5d3d","#2f573f","#99b9e2"];
- var HistohramChartsColor=["#99CC33","#336699","#333300","#3366CC","#99CC33","#333300","#003366",
- "#999933","#FF9933","#996600","#993366","#663366","#CCCC33","#CC3366",
- "#663366","#996699","#CC9999","#006633","#006633","#669933","#669933"];
- var HistohramChartsColor=["#CCCC33","#CC6699","#CC9933","#CC6600","#CC6600","#CC6600","#339999",
- "#CC6699","#CC6699","#FF6666","#FF99CC","#CC3399","#FF99CC","#CC3399",
- "#CC3399","#FF9999","#996699","#FF33CC","#FF6666","#CC6699","#990066"];*/
- //得到当前单位
- var Unit="广东电网公司";//(彭志超)
- var UnitName=Unit+"应急演练统计";
- //类型
- var legendHistohramCharts = ["举办次数","参演人数","投入金额","现场综合演练","桌面综合演练","现场专项演练","桌面专项演练"];
- //单位
- var HistohramUnit=["清远", "江门", "茂名", "韶关", "惠州", "中山", "肇庆", "东莞", "汕尾", "潮州", "阳江", "佛山", "湛江", "汕头", "云浮", "梅州", "河源", "珠海", "揭阳"];
- //参数
- var HistohramPram= [
- {
- name:'举办次数',
- type:'bar',
- data:[18203, 23489, 29034, 104970, 131744, 630230]
- },
- {
- name:'参演人数',
- type:'bar',
- data:[19325, 23438, 31000, 121594, 134141, 681807]
- },
- {
- name:'投入金额',
- type:'bar',
- data:[19325, 23438, 31000, 121594, 134141, 681807]
- },
- {
- name:'现场综合演练',
- type:'bar',
- stack: "综合演练",
- data:[19325, 23438, 31000, 121594, 134141, 681807]
- },
- {
- name:'桌面综合演练',
- type:'bar',
- stack: "综合演练",
- data:[19325, 23438, 31000, 121594, 134141, 681807]
- },
- {
- name:'现场专项演练',
- type:'bar',
- stack: "专项演练",
- data:[19325, 23438, 31000, 121594, 134141, 681807]
- },
- {
- name:'桌面专项演练',
- type:'bar',
- stack: "专项演练",
- data:[19325, 23438, 31000, 121594, 134141, 681807]
- }
- ];
- // Step:3 conifg ECharts's path, link to echarts.js from current page.
- // Step:3 为模块加载器配置echarts的路径,从当前页面链接到echarts.js,定义所需图表路径
- /**
- * @author jiangyongfei
- * @param 获取地图中所有显示的json
- */
- function getChildInfo(){
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getAllSum/';
- var params = {
- deptId : comp_id
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'JSON',
- success : function(data){
- JSON.stringify(data);
- //图例
- legendHistohramCharts=JSON.stringify(data.legendHistohramCharts);
- //单位
- HistohramUnit=JSON.stringify(data.HistohramUnit);
- //参数
- HistohramPram=JSON.stringify(data.HistohramPram);
- for(var i=0;i<5;i++)
- {
- HistohramPram=HistohramPram.replace("\"{normal: {label:{show: true, position: insideRight}}}\"", "{normal: {label:{show: true, position: \"insideRight\"}}}");
- }
- HistohramPram=eval('('+ HistohramPram+')');
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- function emergencyCommandAndRegulatoryAgency()
- {
- require.config({
- paths: {
- echarts: '/nwyj/page/cockpit/tableandmap/js'
- }
- });
- // Step:4 require echarts and use it in the callback.
- // Step:4 动态加载echarts然后在回调函数中开始使用,注意保持按需加载结构定义图表路径
- require(
- [
- 'echarts',
- 'echarts/chart/bar',
- 'echarts/chart/line',
- 'echarts/chart/map',
- 'echarts/chart/pie',
- 'echarts/chart/funnel'
- ],
- function (ec)
- {
- option = {
- title : {
- text:UnitName,
- x:'center',
- y:"0"
- },
- tooltip: {
- trigger: "item",
- axisPointer: {
- type: "shadow"
- },
- show: true,
- islandFormatter: "{a} <br>{b} : {c}",
- textStyle: {
- align: "center",
- baseline: "middle"
- }
- },
- toolbox: {
- show : true,
- y: 'bottom',
- feature : {
- mark : {show: true},
- dataView : {show: true, readOnly: false},
- magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- legend: {
- y:30,
- data:["综合演练","专项演练","现场","桌面","举办次数","参演人数","投入金额"]
- },
- xAxis : [
- {
- type : 'category',
- splitLine : {show : false},
- data : ['举办次数','参演人数','投入金额']
- }
- ],
- yAxis : [
- {
- type : 'value',
- position: 'right'
- }
- ],
- series : [
- {
- name:'举办次数',
- type:'bar',
- barMaxWidth:40,
- data:[100,"",""]
- },
- {
- name:'参演人数',
- type:'bar',
- barMaxWidth:40,
- tooltip : {trigger: 'item'},
- data:["",200,""]
- },
- {
- name:'投入金额',
- type:'bar',
- barMaxWidth:40,
- tooltip : {trigger: 'item'},
- data:["","",300]
- },
-
-
-
- {
- name: "按功能演练分",
- type: "pie",
- tooltip : {
- trigger: 'item',
- formatter: '{a} <br/>{b} : {c} ({d}%)'
- },
- center: [160,130],
- selectedMode: "single",
- radius: [0, 60],
- itemStyle: {
- normal: {
- label: {
- position: "inside"
- },
- labelLine: {
- show: false
- }
- }
- },
- data: [
- {
- value: 100,
- name: "综合演练"
- },
- {
- value: 280,
- name: "专项演练"
- }
- ]
- },
- {
- name: "演练",
- type: "pie",
- tooltip : {
- trigger: 'item'
- },
- center: [160,130],
- radius: [50, 100],
- data: [
- {
- value: 50,
- name: "现场"
- },
- {
- value: 50,
- name: "桌面"
- },
- {
- value: 150,
- name: "现场"
- },
- {
- value: 130,
- name: "桌面"
- }
- ]
- }
-
-
-
- ]
- };
- var myChart = ec.init(document.getElementById('histogram'));
- myChart.setOption(option);
- window.onresize = myChart.resize;
- });
- }
|