Last active
January 6, 2016 00:06
-
-
Save samirbr/677c90873f0b4917a47f to your computer and use it in GitHub Desktop.
Revisions
-
samirbr revised this gist
Jan 6, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,10 +12,10 @@ $http.get('/nodes') $scope.series.push(form.name); $scope.data.push(form.total_harvest_by_month.map(function(monthly) { var month = moment(monthly[0]).utc(); if (!(month.month() in months)) { months[month.month()] = month.format("MMM"); } return monthly[1]; -
samirbr created this gist
Jan 5, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ moment.locale('pt-BR'); $scope.months = []; $scope.series = []; $scope.data = []; $http.get('/nodes') .then(function(response) { var months = {}; response.data.forEach(function(form) { $scope.series.push(form.name); $scope.data.push(form.total_harvest_by_month.map(function(monthly) { var month = moment(perMonth[0]).utc(); if (!(month.month() in months)) { months[month.month()] = months.format("MMM"); } return monthly[1]; })); }); $scope.months = Object.keys(months).map(function(index) { return months[index]; }); });