2018-08-15 09:27:32 -04:00
|
|
|
var angular = require('angular');
|
|
|
|
|
|
|
|
angular.module('DashCtrl', ['chart.js']).controller('DashController', ['$scope', $scope => {
|
2018-08-15 11:23:30 -04:00
|
|
|
const colorScheme = ['#2a9fd6'];
|
|
|
|
|
|
|
|
let weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
|
|
for(let i = 0; i < 6 - (new Date()).getDay(); i++) {
|
|
|
|
const back = weekDays.pop();
|
|
|
|
weekDays.unshift(back);
|
|
|
|
}
|
|
|
|
|
|
|
|
$scope.uploadColors = colorScheme;
|
|
|
|
$scope.uploadLabels = weekDays;
|
2018-08-15 09:27:32 -04:00
|
|
|
$scope.uploadSeries = ['Uploads'];
|
2018-08-15 11:23:30 -04:00
|
|
|
$scope.uploadData = [[10, 20, 30, 20, 15, 20, 45]];
|
2018-08-15 09:27:32 -04:00
|
|
|
$scope.uploadOptions = {
|
2018-08-15 11:23:30 -04:00
|
|
|
title: {
|
|
|
|
display: true,
|
|
|
|
text: 'Historical Uploads'
|
|
|
|
},
|
2018-08-15 09:27:32 -04:00
|
|
|
};
|
|
|
|
|
2018-08-15 11:23:30 -04:00
|
|
|
$scope.viewColors = colorScheme;
|
|
|
|
$scope.viewLabels = weekDays;
|
|
|
|
$scope.viewSeries = ['Views'];
|
|
|
|
$scope.viewData = [[5, 11, 4, 3, 7, 9, 21]];
|
|
|
|
$scope.viewOptions = {
|
|
|
|
title: {
|
|
|
|
display: true,
|
|
|
|
text: 'Historical Views'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}]);
|
|
|
|
{
|
|
|
|
}
|