Commit a9b11b7c authored by Soumya Gouri's avatar Soumya Gouri

changed_chart_url

parent 65cd588a
......@@ -3,16 +3,34 @@ myApp.directive('hcPieChart', function () {
restrict: 'E',
template: '<div></div>',
link: function (scope, element) {
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");
scope.clickMe= function() {
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");
}
scope.clickMe= function(value) {
console.log(value);
console.log(value.Name);
if(value.Id== 1) {
uri = 'Account';
chart = 'column';
} 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");
// }
}
}
};
......@@ -21,10 +39,10 @@ myApp.directive('hcPieChart', function () {
$scope.name = [];
$scope.records = [];
$scope.empSearchId = "";
//$scope.reportId = "1"
$scope.reportId = "2"
$scope.reportId = "1"
//$scope.reportId = "2"
$scope.reports = $scope.reportId;
$scope.reports=[ /*{Name:"Billability Report",Id:"1"},*/{Name:"Billability By Functional Group",Id:"2"},{Name:"Billability Monthly Trends",Id:"3"}];
$scope.reports=[ {Name:"Billability By Account",Id:"1"},{Name:"Billability By Functional Group",Id:"2"},{Name:"Billability Monthly Trends",Id:"3"}];
$scope.employees = [];
......
......@@ -5,9 +5,9 @@
id="popupContainer" ng-controller="chartsController">
<div class="text-right">
Report Type:<select ng-model="reportId" ng-change="clickMe()" ng-options="report.Id as report.Name for report in reports"></select>
Report Type:<select ng-model="report" #ref ng-change="clickMe(report)" ng-options="report.Name for report in reports"></select>
</div>
<hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart>
<div class="row col-lg-12">
......
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