controller.js
1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
angular.module('focaModalGraficoCisternas')
.controller('focaModalGraficoCisternasController', [
'$scope',
'$uibModalInstance',
'filters',
function($scope, $uibModalInstance, filters) {
$scope.labels = [];
$scope.series = ['Disponible', 'Cargado'];
$scope.colores = ['#dcdcdc', '#007bff']
$scope.data = [[],[]];
$scope.options = {
scales: {
xAxes: [{
stacked: true,
}],
yAxes: [{
stacked: true
}]
},
legend: {
display: true,
labels: {
fontColor: 'rgb(255, 99, 132)'
}
}
};
$scope.cerrar = function() {
$uibModalInstance.dismiss('cancel');
};
filters.cisternas.forEach(function(cisterna) {
$scope.labels.push(cisterna.codigo);
$scope.data[0].push(cisterna.capacidad - cisterna.estado.cantidad);
$scope.data[1].push(cisterna.estado.cantidad);
});
}]
);