Commit 60cbf278 authored by Prayas Jain's avatar Prayas Jain

Fixed Utilization Report Alignments

parent c8931b7f
myApp.directive('hcPieChart', function () { myApp.directive('hcPieChart', function () {
return { return {
restrict: 'E', restrict: 'E',
template: '<div></div>', template: '<div></div>',
link: function (scope, element) { link: function (scope, element) {
getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element," Billability Monthly Trends");
//getEmployeeDetails(scope,element[0].baseURI+'reports/billabilityByFunctionalGroup','column',element,"Billability By Functional Group"); //getEmployeeDetails(scope,element[0].baseURI+'reports/billabilityByFunctionalGroup','column',element,"Billability By Functional Group");
//getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByAccount','column',element,"Billability By Account"); //getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByAccount','column',element,"Billability By Account");
scope.clickMe= function(value) { scope.clickMe= function() {
console.log(value); if(scope.reportId == 1){
getEmployeeDetails(scope,element[0].baseURI+'reports/getBarChartReport?byType=Account','column',element,"Billability By Account");
console.log(value.Name); }else if(scope.reportId == 2){
if(value.Id== 1) { getEmployeeDetails(scope,element[0].baseURI+'reports/getBarChartReport?byType=FunctionalGroup','column',element,"Billability By Functional Group");
uri = 'Account'; }else if(scope.reportId == 3){
chart = 'column'; getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element," Billability Monthly Trends");
} else if(value.Id == 2){
uri = 'FunctionalGroup';
chart = 'column';
}
else if(value.Id == 3){
uri = 'Month';
chart = 'line';
} }
desc = value.Name;
console.log(desc);
getEmployeeDetails(scope,element[0].baseURI+'reports/getBarChartReport?byType='+uri,chart,element,desc);
//alert(value);
// if(scope.reportId == 1){
// getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByAccount','column',element," Billability By Account");
// }else if(scope.reportId == 2){
// getEmployeeDetails(scope,element[0].baseURI+'reports/billabilityByFunctionalGroup','column',element,"Billability By Functional Group");
// }else if(scope.reportId == 3){
// getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element," Billability Monthly Trends");
// }
} }
} }
}; };
...@@ -40,9 +24,8 @@ myApp.directive('hcPieChart', function () { ...@@ -40,9 +24,8 @@ myApp.directive('hcPieChart', function () {
$scope.records = []; $scope.records = [];
$scope.empSearchId = ""; $scope.empSearchId = "";
$scope.reportId = "1" $scope.reportId = "1"
//$scope.reportId = "2"
$scope.reports = $scope.reportId; $scope.reports = $scope.reportId;
$scope.reports=[ {Name:"Billability By Account",Id:"1"},{Name:"Billability By Functional Group",Id:"2"},{Name:"Billability Monthly Trends",Id:"3"}]; $scope.reports=[ {Name:"Billability Monthly Trends",Id:"1"},{Name:"Billability By Functional Group",Id:"2"},{Name:"Billability By Account",Id:"3"}];
$scope.employees = []; $scope.employees = [];
...@@ -131,7 +114,7 @@ myApp.directive('hcPieChart', function () { ...@@ -131,7 +114,7 @@ myApp.directive('hcPieChart', function () {
}else if(title.trim() == 'Billability By Account'){ }else if(title.trim() == 'Billability By Account'){
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "/reports/fetchEmployeeDetailsByAccountBillability?account="+category+"&billabilityStatus="+seriesName url : appConfig.appUri + "reports/fetchEmployeeDetailsByAccountBillability?account="+category+"&billabilityStatus="+seriesName
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
if(response.data.length > 10){ if(response.data.length > 10){
...@@ -147,7 +130,7 @@ myApp.directive('hcPieChart', function () { ...@@ -147,7 +130,7 @@ myApp.directive('hcPieChart', function () {
}else if(title.trim() == 'Billability Monthly Trends'){ }else if(title.trim() == 'Billability Monthly Trends'){
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "/reports/fetchEmployeeDetailsByDateBillability?billabilityStatus="+seriesName+"&reportDate="+category url : appConfig.appUri + "reports/fetchEmployeeDetailsByDateBillability?billabilityStatus="+seriesName+"&reportDate="+category
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
if(response.data.length > 10){ if(response.data.length > 10){
...@@ -175,7 +158,7 @@ myApp.directive('hcPieChart', function () { ...@@ -175,7 +158,7 @@ myApp.directive('hcPieChart', function () {
Highcharts.chart(element[0], { Highcharts.chart(element[0], {
chart: { chart: {
type: chartName, type: chartName,
height: '300px' height: '275px'
}, },
title: { title: {
text: title text: title
......
...@@ -664,5 +664,9 @@ cursor: pointer; ...@@ -664,5 +664,9 @@ cursor: pointer;
height: calc(85vh - 168px) !important; height: calc(85vh - 168px) !important;
} }
.utilization-report { .utilization-report {
height: calc(86vh - 346px) !important; height: calc(86vh - 346px) !important;
}
.highcharts-menu {
height: 205px;
overflow-y: scroll;
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
id="popupContainer" ng-controller="chartsController"> id="popupContainer" ng-controller="chartsController">
<div class="text-right"> <div class="text-right">
Report Type:<select ng-model="report" #ref ng-change="clickMe(report)" ng-options="report.Name for report in reports"></select> Report Type:<select ng-model="reportId" #ref ng-change="clickMe()" ng-options="report.Id as report.Name for report in reports"></select>
</div> </div>
<hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart> <hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment