sjsq_5.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. $(document).ready(function () {
  2. let dom = document.getElementById("sjsq5");
  3. let myChart = echarts.init(dom);
  4. let app = {};
  5. let colors0 = ['#cc9933', '#00cc99', '#3043f2', '#3414d9'];
  6. let colors1 = ['#ffcc00', '#00ffcc', '#00fff0', '#5519ff'];
  7. let option;
  8. $.post(ctx + "fzjc/sjsqYsjzstj",function (res){
  9. option = {
  10. tooltip: {
  11. trigger: 'axis'
  12. },
  13. grid: {
  14. top:'20%',
  15. left: '2%',
  16. right: '2%',
  17. bottom: '2%',
  18. containLabel: true
  19. },
  20. legend: {
  21. data: ['上报总数', '办结总数'],
  22. textStyle: {
  23. color:'#00cdef'
  24. }
  25. },
  26. xAxis: [
  27. {
  28. type: 'category',
  29. data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
  30. axisLabel: {
  31. color: '#00cdef'
  32. },
  33. axisLine: {
  34. show: true,
  35. lineStyle: {
  36. color: '#00cdef'
  37. }
  38. },
  39. splitLine: {
  40. show: false
  41. },
  42. axisPointer: {
  43. type: 'shadow'
  44. }
  45. }
  46. ],
  47. yAxis: [
  48. {
  49. type: 'value',
  50. name: '上报总数',
  51. axisLabel: {
  52. formatter: '{value}',
  53. color: '#00cdef'
  54. },
  55. axisLine: {
  56. show: true,
  57. lineStyle: {
  58. color: '#00cdef'
  59. }
  60. },
  61. splitLine: {
  62. show: false
  63. },
  64. }
  65. ],
  66. series: [
  67. {
  68. name: '上报总数',
  69. type: 'bar',
  70. data: res.sjsbtj,
  71. itemStyle: {
  72. color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
  73. offset: 0,
  74. color: "#006aff"
  75. }, {
  76. offset: 1,
  77. color: "#00cfe4"
  78. }]),
  79. }
  80. },
  81. {
  82. name: '办结总数',
  83. type: 'line',
  84. data: res.sjbjtj,
  85. itemStyle: {
  86. color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
  87. offset: 0,
  88. color: "#ddbb00"
  89. }, {
  90. offset: 1,
  91. color: "#00dd9c"
  92. }]),
  93. }
  94. },
  95. ]
  96. };
  97. if (option && typeof option === 'object') {
  98. myChart.setOption(option);
  99. myChart.on("click",function (params) {
  100. let prefix = ctx ;
  101. let month;
  102. let type;
  103. month = params.name.replace("月","");//月份
  104. switch(params.seriesName){//类型 1上报,2办结
  105. case "上报总数" : type = 1; break;
  106. case "办结总数" : type = 2; break;
  107. }
  108. console.log(prefix + "fzjc/goSjsqBar/"+month+"/"+type);
  109. let btn = ['<i class="fa fa-close"></i> 关闭'];
  110. let options = {
  111. title: '月事件总数统计',
  112. width: "1000",
  113. height: "550",
  114. url: prefix + "fzjc/goSjsqBar/"+month+"/"+type,
  115. btn: btn,
  116. callBack: doSubmit
  117. };
  118. $.modal.openOptions(options);
  119. });
  120. function doSubmit(index, layero){
  121. layer.close(index);
  122. }
  123. }
  124. });
  125. });