Skip to content

Commit 7f4072c

Browse files
committed
changes with progress bar in them
1 parent 4638813 commit 7f4072c

4 files changed

Lines changed: 39 additions & 7 deletions

File tree

learning_web_proj/angularLearning/angular_1.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<script src='app/directives/directives.js'></script>
1818
<script src='app/factories/esriStatsFactory.js'></script>
1919
<script src='scripts/ui-bootstrap-tpls-0.10.0.min.js'></script>
20+
<script src="http://bouil.github.io/angular-google-chart/ng-google-chart.js"></script>
2021
</head>
2122
<body>
2223
<div ng-view></div>

learning_web_proj/angularLearning/app/controllers/reportConfigController.js

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,30 @@ var cntrlFunction = function ($scope, $routeParams, $location, runReportFactory)
118118
utcEnd = $scope.endDate.getUTCDate()
119119
console.log('utcStart' + utcStart);
120120
console.log('utcEnd' + utcEnd);
121-
121+
$scope.showprogress = true;
122+
$scope.progressMessage = 'Getting data... (can take a few minutes)'
123+
$scope.progressbarState = 100;
124+
// TODO: modify this query to run a separate query per product
122125
$scope.reportData = runReportFactory.query(
123126
{'startDate': utcStart,
124127
'endDate': utcEnd,
125128
'reportResolution': reportResolution}, function() {
126129
var i, j, row;
127-
for ( i=0; i<$scope.reportData.length; i++) {
130+
// $scope.reportData array of objects!
131+
// [ {0: <date>, 1:<number>}]
132+
133+
134+
135+
for ( i=0; i<$scope.reportData.length; i+=1) {
128136
vals = '';
129-
for ( j=0; j<$scope.reportData[i].length; j++) {
130-
vals + $scope.reportData[i][j]
137+
keys = Object.keys($scope.reportData[i])
138+
for ( j=0; j<keys.length; j++) {
139+
vals = vals + ' - ' + $scope.reportData[i][j]
131140
}
141+
132142
console.log("vals: " + vals);
143+
144+
console.log("keys " + keys )
133145
}
134146
console.log('report data: ' + $scope.reportData);
135147
});
@@ -141,6 +153,15 @@ var cntrlFunction = function ($scope, $routeParams, $location, runReportFactory)
141153

142154
};
143155

156+
function showChart() {
157+
$scope.chart = {
158+
type: 'LineChart',
159+
displayed: true,
160+
data: '',
161+
rows:
162+
}
163+
}
164+
144165
// $scope.open = function() {
145166
// var modelInstance = $modal.open({
146167
// templateUrl: 'app/partials/backendConfig.html',
@@ -151,7 +172,17 @@ var cntrlFunction = function ($scope, $routeParams, $location, runReportFactory)
151172
// })
152173

153174
//};//
154-
175+
176+
// progress bar stuff
177+
$scope.progressBarType = 'info';
178+
$scope.showWarning = true;
179+
$scope.showprogress = false;
180+
$scope.progressbarState = 0;
181+
$scope.progressMessage = '';
182+
183+
184+
185+
155186
};
156187

157188
ESRIStatsApp.controller('reportConfigController', ['$scope', '$routeParams', '$location', 'runReportFactory', cntrlFunction]);

learning_web_proj/angularLearning/app/partials/reportConfig.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ <h5>
7272
<div id='report'>
7373
<div class='row'>
7474
<div class='col-xs-6' align='right'>
75-
75+
<progressbar animate='true' class="progress-striped active" value="progressbarState" ng-show='showprogress' type="progressBarType">{{progressMessage}} </progressbar>
7676
</div>
7777
</div>
7878
</div>

learning_web_proj/angularLearning/app/routes/EsriStatsModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var ESRIStatsApp = angular.module('ESRIStatsApp', ['ngRoute', 'ui.bootstrap', 'esriStatsServices']);
1+
var ESRIStatsApp = angular.module('ESRIStatsApp', ['ngRoute', 'ui.bootstrap', 'esriStatsServices', 'googlechart']);
22

33

44
var routeFunction = function($routeProvider) {

0 commit comments

Comments
 (0)