Commit b944d384c369a39c2d24833654553aa6e24bb5ce

Authored by Kuldeep Arora
1 parent 75d1c3d9f2
Exists in master

analytics UI

app/partials/analytics/analytics.controller.js
... ... @@ -12,11 +12,17 @@
12 12 backgroundColor: '#ffce99',
13 13 },
14 14 mapUrlByCode: function(code, multiMap){
  15 + console.log('-----s-----s-s--',code.toLowerCase())
15 16 return '/js/us-counties/jquery-jvectormap-data-'+
16 17 code.toLowerCase()+'-'+
17 18 multiMap.defaultProjection+'-en.js';
18   - }
  19 + },
  20 + onRegionClick:function(event, code) {
  21 + var name = (code);
  22 + alert(name);
  23 + }
19 24 });
  25 +
20 26 });
21 27 })
22 28  
... ... @@ -291,6 +297,7 @@
291 297 $scope.getCS = function(){
292 298 //var makeId = makeId;
293 299 analyticsService.getCS().then(function(result) {
  300 + console.log("==cs values==",result)
294 301 $scope.csValues = result;
295 302 //console.log("cs data kd --- ",$scope.csValues)
296 303 $scope.optionscs = {
... ... @@ -323,6 +330,8 @@
323 330 }
324 331  
325 332 $scope.getCS();
  333 +
  334 + /*Historic Fuel Price */
326 335 $scope.optionshfp = {
327 336 chart: {
328 337 type: 'cumulativeLineChart',
... ... @@ -493,11 +502,11 @@
493 502  
494 503 /*Date Range Filter for Customer Sources*/
495 504 $scope.submitDateCs = function(){
  505 + console.log("==fromdate===",$scope.cs.fromDate)
  506 + console.log("====todate=====",$scope.cs.toDate)
496 507  
497 508 if ($scope.cs.fromDate === undefined) {
498 509  
499   - // console.log("==frmdate====",$scope.drf.fromDate);
500   - //console.log("==toDate====",$scope.drf.toDate);
501 510 $scope.fillForm = true;
502 511 }
503 512 else if($scope.cs.fromDate != undefined && $scope.cs.toDate === undefined || $scope.cs.toDate ===''){
... ... @@ -511,12 +520,34 @@
511 520 $scope.fd1[2] = $scope.fd1[1];
512 521 $scope.fd1[1] = $scope.tmp;
513 522 $scope.fd = $scope.fd1.join("-");
514   - // console.log("===fd====",$scope.fd);
515   - //console.log("----td curr---",DefaultToDate);
516 523 analyticsService.getDRFCSChart($scope.fd,DefaultToDate).then(function(result) {
517   - //console.log("==date received==",$scope.fd);
518   - //console.log("----to date receivedcurrent---",DefaultToDate)
519   - $scope.datacs = result;
  524 + $scope.csValues = result;
  525 + $scope.optionscs = {
  526 + chart: {
  527 + type: 'pieChart',
  528 + height: 500,
  529 + // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"],
  530 + x: function(d){return d.key;},
  531 + y: function(d){return d.y;},
  532 + showLabels: false,
  533 + segmentShowStroke : false,
  534 + animationSteps : 20,
  535 + animationEasing : "linear",
  536 + animateScale : true,
  537 + duration: 500,
  538 + labelThreshold: 0.01,
  539 + labelSunbeamLayout: true,
  540 + legend: {
  541 + margin: {
  542 + top: 5,
  543 + right: 35,
  544 + bottom: 5,
  545 + left: 0
  546 + }
  547 + }
  548 + }
  549 + };
  550 + $scope.datacs = $scope.csValues;
520 551 })
521 552  
522 553  
... ... @@ -538,9 +569,33 @@
538 569 $scope.td = $scope.td1.join("-");
539 570  
540 571 analyticsService.getDRFCSChart($scope.fd,$scope.td).then(function(result) {
541   - // console.log("==date received==",$scope.fd);
542   - //console.log("----to date received---",$scope.td)
543   - $scope.datacs = result;
  572 + $scope.csValues = result;
  573 + $scope.optionscs = {
  574 + chart: {
  575 + type: 'pieChart',
  576 + height: 500,
  577 + // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"],
  578 + x: function(d){return d.key;},
  579 + y: function(d){return d.y;},
  580 + showLabels: false,
  581 + segmentShowStroke : false,
  582 + animationSteps : 20,
  583 + animationEasing : "linear",
  584 + animateScale : true,
  585 + duration: 500,
  586 + labelThreshold: 0.01,
  587 + labelSunbeamLayout: true,
  588 + legend: {
  589 + margin: {
  590 + top: 5,
  591 + right: 35,
  592 + bottom: 5,
  593 + left: 0
  594 + }
  595 + }
  596 + }
  597 + };
  598 + $scope.datacs = $scope.csValues;
544 599 })
545 600  
546 601 }else
... ... @@ -553,16 +608,6 @@
553 608  
554 609  
555 610  
556   -
557   -
558   -
559   -
560   -
561   -
562   -
563   -
564   -
565   -
566 611 }]);
567 612  
568 613  
... ...
app/partials/analytics/analytics.service.js
... ... @@ -77,7 +77,7 @@
77 77 var deferred = $q.defer();
78 78 $http({
79 79 method : 'GET',
80   - url : BASE_URL.url + '/fuelOrder/cs/filterchart?fromDate='+fd+'&toDate='+td+''
  80 + url : BASE_URL.url + '/user/cs/filterchart?fromDate='+fd+'&toDate='+td+''
81 81 })
82 82 .then(function (result){
83 83 deferred.resolve(result.data);
... ...