123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- 'use strict';
- var app = angular.module('app', [
- 'angularUtils.directives.dirPagination'
- ]);
- app.controller("totalCtrl", ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) {
- var self = this;
- var s4 = new SM4Util();
- self.userId = $.cookie("GlWorkPlatform-userid");
- self.userName = $.cookie("GlWorkPlatform-chineseName");
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
- self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
- var postCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + self.get_AccessToken
- }
- }
- self.getChart1 = function () {
- var data = [{ name: "10年", y: 150 }, { name: "30年", y: 92 }, { name: "永久", y: 52 }]
- var chart = new Highcharts.Chart({
- chart: {
- renderTo: "chart1",
- type: 'pie',
- style: {
- position: 'relative',
- left: '-30px'
- }
- },
- title: {
- text: '档案保管期限统计(卷)', //图表的标题
- //margin: 80
- },
- tooltip: {
- pointFormat: '{point.name}: <b>{point.y}卷</b>'
- },
- colors: ['#4A90E2', '#F5A623', '#FF8080', '#906EDB', '#758790'],
- legend: {
- align: 'center',
- verticalAlign: 'bottom',
- layout:'horizontal',// 'vertical',
- enabled: true,
- },
- plotOptions: {
- pie: {
- allowPointSelect: true,
- cursor: 'pointer',
- size: 300,
- dataLabels: {
- enabled: true,
- distance: -50,
- //formatter: function () {
- // return this.point.name + ":" + this.y + "卷";
- //}
- },
- showInLegend: true
- }
- },
- series: [{
- name: "数量",
- data: data
- }],
- credits: {
- enabled: false//隐藏右下角网址
- },
- exporting: {
- enabled: false//隐藏右上角打印
- }
- })
- chart.setSize(null, 450)
- }
- self.getChart1()
- self.getChart2 = function () {
- var chart = new Highcharts.Chart({
- chart: {
- renderTo: "chart2",
- type: 'column'
- },
- title: {
- text: '档案年度数量统计(件)', //图表的标题
- //margin: 80
- },
- tooltip: {
- headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
- pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
- '<td style="padding:0"><b>{point.y}</b>{series.className}</td></tr>',
- footerFormat: '</table>',
- shared: true,
- useHTML: true
- },
- xAxis: {
- categories: [2019, 2020, 2021, 2022, 2023]
- },
- yAxis: {
- title: {
- text: ''
- },
- lineWidth: 1,
- gridLineWidth: 1
- },
- legend: {
- align: 'center',
- verticalAlign: 'bottom',
- layout: 'horizontal',
- enabled: true
- },
- plotOptions: {
- series: {
- turboThreshold: 0,
- cursor: 'pointer',
- dataLabels: {
- enabled: true,
- },
- events: {
- click: function (e) {
- sp.layer("#detail")
- }
- },
- }
- },
- series: [{ name: "10年", data: [610, 560, 703, 482, 665] },
- { name: "30年", data: [387, 341, 201, 506, 401] },
- { name: "永久", data: [100, 240, 300, 220, 180] }
- ],
- credits: {
- enabled: false//隐藏右下角网址
- },
- exporting: {
- enabled: false//隐藏右上角打印
- }
- })
- chart.setSize(null,450)
- }
- self.getChart2()
- }])
|