Skip to content

Commit 2a32eab

Browse files
authored
Merge pull request #18 from mathisjay/issue-17
fix issue #17
2 parents a023d89 + 90d37bb commit 2a32eab

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

Controllers/VisitController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace Dnn.WebAnalytics
1717
[ValidateAntiForgeryToken]
1818
public class VisitController : DnnApiController
1919
{
20-
VisitorController visitorController = new VisitorController();
2120
DataContext dc = new DataContext();
2221
public static string UserAgentFilter = "bot|crawl|spider|sbider|ask|slurp|larbin|search|indexer|archiver|nutch|capture|scanalert";
2322

app/controllers/view.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
$scope.visitor_count = 0;
99
$scope.user_count = 0;
1010

11+
$scope.chart;
12+
1113
$scope.field = "date";
1214
$scope.rows = "10";
1315

@@ -53,20 +55,23 @@
5355
$scope.period_start.setDate($scope.period_end.getDate() - 7);
5456

5557
$scope.getDashboard();
58+
$scope.getReport();
5659
};
5760
$scope.lastMonth = function () {
5861
$scope.period_end = new Date();
5962
$scope.period_start = new Date();
6063
$scope.period_start.setDate($scope.period_end.getDate() - 30);
6164

6265
$scope.getDashboard();
66+
$scope.getReport();
6367
};
6468
$scope.last3Months = function () {
6569
$scope.period_end = new Date();
6670
$scope.period_start = new Date();
6771
$scope.period_start.setDate($scope.period_end.getDate() - 90);
6872

6973
$scope.getDashboard();
74+
$scope.getReport();
7075
};
7176

7277
$scope.getDashboard = function () {
@@ -78,7 +83,7 @@
7883
function (response) {
7984
var dashboardDTO = response.data;
8085

81-
console.log(dashboardDTO);
86+
//console.log(dashboardDTO);
8287

8388
$scope.view_count = dashboardDTO.view_count;
8489
$scope.visit_count = dashboardDTO.visit_count;
@@ -169,6 +174,7 @@
169174
}
170175
$scope.chart_data = [views, visits, visitors, users];
171176

177+
$scope.chart.update();
172178
$scope.dashboard_loading = false;
173179
},
174180
function (response) {
@@ -190,7 +196,7 @@
190196
function (response) {
191197
$scope.report_rows = response.data;
192198

193-
console.log($scope.report_rows);
199+
//console.log($scope.report_rows);
194200

195201
$scope.pie_chart_labels = [];
196202
$scope.pie_chart_data = [];
@@ -224,13 +230,16 @@
224230
$scope.getReport();
225231
};
226232

233+
$scope.$on('chart-create', function (evt, chart) {
234+
$scope.chart = chart;
235+
});
236+
227237
init = function () {
228238
var promises = [];
229239
return $q.all(promises);
230240
};
231241
init();
232242
$scope.lastWeek();
233243
$scope.getReport();
234-
235244
}]);
236245

0 commit comments

Comments
 (0)