You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

  1. 'use strict';
  2. angular.module('app.dateAnalysis', ['ngRoute', 'chart.js'])
  3. .config(['$routeProvider', function($routeProvider) {
  4. $routeProvider.when('/dateAnalysis', {
  5. templateUrl: 'views/dateAnalysis/dateAnalysis.html',
  6. controller: 'DateAnalysisCtrl'
  7. });
  8. }])
  9. .controller('DateAnalysisCtrl', function($scope, $http, $routeParams) {
  10. $scope.totalhour={
  11. data: [],
  12. labels: []
  13. };
  14. $http.get(urlapi + 'totalhouranalysis')
  15. .then(function(data, status, headers, config) {
  16. console.log('data success');
  17. console.log(data);
  18. $scope.totalhour.data = data.data.data;
  19. $scope.totalhour.labels=data.data.labels;
  20. }, function(data, status, headers, config) {
  21. console.log('data error');
  22. });
  23. //date analysis
  24. $scope.last24hour= {
  25. data:[],
  26. labels: []
  27. };
  28. $http.get(urlapi + 'last24hour')
  29. .then(function(data, status, headers, config) {
  30. console.log('data success');
  31. console.log(data);
  32. $scope.last24hour.data = data.data.data;
  33. $scope.last24hour.labels = data.data.labels;
  34. }, function(data, status, headers, config) {
  35. console.log('data error');
  36. });
  37. });