list-total.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. 'use strict';
  2. var app = angular.module('app', [
  3. 'angularUtils.directives.dirPagination'
  4. ]);
  5. app.controller("totalCtrl", ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) {
  6. var self = this;
  7. var s4 = new SM4Util();
  8. self.userId = $.cookie("GlWorkPlatform-userid");
  9. self.userName = $.cookie("GlWorkPlatform-chineseName");
  10. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  11. self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
  12. var postCfg = {
  13. headers: {
  14. 'Content-Type': 'application/json',
  15. 'Authorization': "Bearer " + self.get_AccessToken
  16. }
  17. }
  18. self.getChart1 = function () {
  19. var data = [{ name: "10年", y: 150 }, { name: "30年", y: 92 }, { name: "永久", y: 52 }]
  20. var chart = new Highcharts.Chart({
  21. chart: {
  22. renderTo: "chart1",
  23. type: 'pie',
  24. style: {
  25. position: 'relative',
  26. left: '-30px'
  27. }
  28. },
  29. title: {
  30. text: '档案保管期限统计(卷)', //图表的标题
  31. //margin: 80
  32. },
  33. tooltip: {
  34. pointFormat: '{point.name}: <b>{point.y}卷</b>'
  35. },
  36. colors: ['#4A90E2', '#F5A623', '#FF8080', '#906EDB', '#758790'],
  37. legend: {
  38. align: 'center',
  39. verticalAlign: 'bottom',
  40. layout:'horizontal',// 'vertical',
  41. enabled: true,
  42. },
  43. plotOptions: {
  44. pie: {
  45. allowPointSelect: true,
  46. cursor: 'pointer',
  47. size: 300,
  48. dataLabels: {
  49. enabled: true,
  50. distance: -50,
  51. //formatter: function () {
  52. // return this.point.name + ":" + this.y + "卷";
  53. //}
  54. },
  55. showInLegend: true
  56. }
  57. },
  58. series: [{
  59. name: "数量",
  60. data: data
  61. }],
  62. credits: {
  63. enabled: false//隐藏右下角网址
  64. },
  65. exporting: {
  66. enabled: false//隐藏右上角打印
  67. }
  68. })
  69. chart.setSize(null, 450)
  70. }
  71. self.getChart1()
  72. self.getChart2 = function () {
  73. var chart = new Highcharts.Chart({
  74. chart: {
  75. renderTo: "chart2",
  76. type: 'column'
  77. },
  78. title: {
  79. text: '档案年度数量统计(件)', //图表的标题
  80. //margin: 80
  81. },
  82. tooltip: {
  83. headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
  84. pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
  85. '<td style="padding:0"><b>{point.y}</b>{series.className}</td></tr>',
  86. footerFormat: '</table>',
  87. shared: true,
  88. useHTML: true
  89. },
  90. xAxis: {
  91. categories: [2019, 2020, 2021, 2022, 2023]
  92. },
  93. yAxis: {
  94. title: {
  95. text: ''
  96. },
  97. lineWidth: 1,
  98. gridLineWidth: 1
  99. },
  100. legend: {
  101. align: 'center',
  102. verticalAlign: 'bottom',
  103. layout: 'horizontal',
  104. enabled: true
  105. },
  106. plotOptions: {
  107. series: {
  108. turboThreshold: 0,
  109. cursor: 'pointer',
  110. dataLabels: {
  111. enabled: true,
  112. },
  113. events: {
  114. click: function (e) {
  115. sp.layer("#detail")
  116. }
  117. },
  118. }
  119. },
  120. series: [{ name: "10年", data: [610, 560, 703, 482, 665] },
  121. { name: "30年", data: [387, 341, 201, 506, 401] },
  122. { name: "永久", data: [100, 240, 300, 220, 180] }
  123. ],
  124. credits: {
  125. enabled: false//隐藏右下角网址
  126. },
  127. exporting: {
  128. enabled: false//隐藏右上角打印
  129. }
  130. })
  131. chart.setSize(null,450)
  132. }
  133. self.getChart2()
  134. }])