Commit 7b21cec8fa57ef7e97ba6628a0cf3750d92ebf84
1 parent
70200a3cae
Exists in
master
analytical regional pap chart
Showing
7 changed files
with
149 additions
and
17 deletions
Show diff stats
app/index.html
... | ... | @@ -117,14 +117,17 @@ |
117 | 117 | <script src="scripts/inspinia.js"></script> |
118 | 118 | <script src="plugins/iCheck/icheck.min.js"></script> |
119 | 119 | --> |
120 | - | |
121 | -<!-- <script src="./js/Application.js"></script> | |
120 | + | |
121 | + <!-- This 7 lines are for old regional chart--> | |
122 | + <!-- <script src="./js/Application.js"></script> | |
122 | 123 | <script src="js/charts/area.js"></script> |
123 | 124 | <script src="js/charts/donut.js"></script> |
124 | 125 | <script src="js/charts/pie.js"></script> |
125 | 126 | <script src="js/charts/bar.js"></script> |
126 | 127 | <script src="js/demo/validation.js"></script> |
127 | - <script src="js/charts/line.js"></script> --> | |
128 | + <script src="js/charts/line.js"></script> --> | |
129 | + | |
130 | + | |
128 | 131 | <script src="js/demo/faq.js"></script> |
129 | 132 | <script src="js/plugins/faq/faq.js"></script> |
130 | 133 | <script src="js/demo/gallery.js"></script> |
... | ... | @@ -239,7 +242,7 @@ |
239 | 242 | |
240 | 243 | <script src="bower_components/angular-nvd3/dist/angular-nvd3.js"></script> |
241 | 244 | |
242 | - <!-- for reginal pap graph --> | |
245 | + <!-- for reginal pap graph uncomment this for new red chart and html code--> | |
243 | 246 | <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> |
244 | 247 | <script src="https://code.highcharts.com/maps/js/highmaps.js"></script> |
245 | 248 | <script src="https://code.highcharts.com/maps/js/modules/data.js"></script> | ... | ... |
app/partials/analytics/analytics.controller.js
... | ... | @@ -2,7 +2,101 @@ |
2 | 2 | angular.module('acufuel') |
3 | 3 | .controller('analyticsController', ['$scope', 'analyticsService', function($scope, analyticsService) { |
4 | 4 | |
5 | - $(document).ready(function() { | |
5 | + | |
6 | + | |
7 | + $scope.getAllRegionalPap = function() { | |
8 | + $scope.flag=true; | |
9 | + $scope.stateList = [{region:'Alabama',code:'AL'},{region:'Alaska',code:'AK'},{region:'Arizona',code:'AZ'},{region:'Arkansas',code:'AR'}, | |
10 | + {region:'California',code:'CA' },{region:'Colorado',code:'CO'},{region:'Connecticut',code:'CT'},{region:'Delaware',code:'DE'}, | |
11 | + {region:'Florida' ,code:'FL'},{region:'Georgia' ,code:'GA'},{region:'Hawaii' ,code:'HI'},{region:'Idaho' ,code:'ID'}, | |
12 | + {region:'Illinois',code:'IL'},{region:'Indiana' ,code:'IN'},{region:'Iowa' ,code:'IA'},{region:'Kansas' ,code:'KS'}, | |
13 | + {region:'Kentucky' ,code:'KY'},{region:'Louisiana' ,code:'LA'},{region:'Maine' ,code:'ME'},{region:'Maryland' ,code:'MD'}, | |
14 | + {region:'Massachusetts' ,code:'MA'},{region:'Michigan' ,code:'MI'},{region:'Minnesota' ,code:'MN'}, | |
15 | + {region:'Mississippi' ,code:'MS'},{region:'Missouri' ,code:'MO'},{region:'Montana',code:'MT'},{region:'Nebraska' ,code:'NE'}, | |
16 | + {region:'Nevada' ,code:'NV'},{region:'New Hampshire' ,code:'NH'},{region:'New Jersey' ,code:'NJ'},{region:'New Mexico' ,code:'NM'}, | |
17 | + {region:'New York' ,code:'NY'},{region:'North Carolina' ,code:'NC'},{region:'North Dakota' ,code:'ND'},{region:'Ohio' ,code:'OH'}, | |
18 | + {region:'Oklahoma' ,code:'OK'},{region:'Oregon' ,code:'OR'},{region:'Pennsylvania',code:'PA'},{region:'Rhode Island' ,code:'RI'}, | |
19 | + {region:'South Carolina' ,code:'SC'},{region:'South Dakota' ,code:'SD'},{region:'Tennessee' ,code:'TN'},{region:'Texas' ,code:'TX'}, | |
20 | + {region:'Utah' ,code:'UT'},{region:'Vermont' ,code:'VT'},{region:'Virginia' ,code:'VA'},{region:'Washington' ,code:'WA'}, | |
21 | + {region:'West Virginia' ,code:'WV'},{region:'Wisconsin' ,code:'WI'},{region:'Wyoming',code:'WY'}] | |
22 | + | |
23 | + analyticsService.getAllRPP().then(function(result) { | |
24 | + for (var i = 0; i < $scope.stateList.length; i++) { | |
25 | + for (var j = 0; j<result.length; j++){ | |
26 | + if ($scope.stateList[i].region === result[j].region) { | |
27 | + result[j].code = $scope.stateList[i].code; | |
28 | + } | |
29 | + } | |
30 | + } | |
31 | + $scope.flag=false; | |
32 | + // Instantiate the map | |
33 | + Highcharts.mapChart('regional-pap', { | |
34 | + | |
35 | + chart: { | |
36 | + map: 'countries/us/us-all', | |
37 | + borderWidth: 1, | |
38 | + }, | |
39 | + | |
40 | + title: { | |
41 | + text: 'Regional PAP' | |
42 | + }, | |
43 | + | |
44 | + exporting: { | |
45 | + sourceWidth: 600, | |
46 | + sourceHeight: 500 | |
47 | + }, | |
48 | + | |
49 | + legend: { | |
50 | + layout: 'vertical', | |
51 | + borderWidth: 0, | |
52 | + backgroundColor: 'rgba(255,255,255,0.85)', | |
53 | + floating: true, | |
54 | + width:'12px', | |
55 | + height:'200px', | |
56 | + verticalAlign: 'bottom', | |
57 | + y: 0, | |
58 | + x: -230, | |
59 | + }, | |
60 | + | |
61 | + mapNavigation: { | |
62 | + enabled: true | |
63 | + }, | |
64 | + | |
65 | + /* colorAxis: { | |
66 | + min: 1, | |
67 | + type: 'logarithmic', | |
68 | + minColor: '#2b908f', | |
69 | + maxColor: '#000022', | |
70 | + stops: [ | |
71 | + [0, '#EFEFFF'], | |
72 | + [5, '#f45b5b'], | |
73 | + [10, 'rgb(117,0,0)'] | |
74 | + ] | |
75 | + },*/ | |
76 | + | |
77 | + series: [{ | |
78 | + animation: { | |
79 | + duration: 1000 | |
80 | + }, | |
81 | + data: result, | |
82 | + joinBy: ['postal-code', 'code'], | |
83 | + dataLabels: { | |
84 | + enabled: true, | |
85 | + color: '#FFFFFF', | |
86 | + format: '{point.code}' | |
87 | + }, | |
88 | + name: 'Data' , | |
89 | + tooltip: { | |
90 | + pointFormat: '{point.region} : {point.averagePAP}' | |
91 | + }, | |
92 | + }] | |
93 | + }); | |
94 | + }) | |
95 | + } | |
96 | + | |
97 | + $scope.getAllRegionalPap(); | |
98 | + | |
99 | + /*$(document).ready(function() { | |
6 | 100 | $(function() { |
7 | 101 | jQuery('#map').vectorMap({ |
8 | 102 | map: 'us_lcc', |
... | ... | @@ -23,7 +117,8 @@ angular.module('acufuel') |
23 | 117 | normalizeFunction: 'polynomial' |
24 | 118 | }); |
25 | 119 | }); |
26 | - }) | |
120 | + })*/ | |
121 | + | |
27 | 122 | |
28 | 123 | function getRegionPap(code) { |
29 | 124 | $scope.showLoader = true; |
... | ... | @@ -33,6 +128,7 @@ angular.module('acufuel') |
33 | 128 | $('#popup1').css('display', 'block'); |
34 | 129 | }) |
35 | 130 | } |
131 | + | |
36 | 132 | $scope.cancelStatus = function() { |
37 | 133 | $('#popup1').css('display', 'none'); |
38 | 134 | } |
... | ... | @@ -135,7 +231,7 @@ angular.module('acufuel') |
135 | 231 | //var makeId = makeId; |
136 | 232 | analyticsService.gethfpChart().then(function(result) { |
137 | 233 | $scope.hfpValues = result; |
138 | - console.log('---kd result--',$scope.hfpValues); | |
234 | + //console.log('---kd result--',$scope.hfpValues); | |
139 | 235 | |
140 | 236 | /*Historic Fuel Price */ |
141 | 237 | |
... | ... | @@ -519,5 +615,4 @@ angular.module('acufuel') |
519 | 615 | } |
520 | 616 | |
521 | 617 | |
522 | - | |
523 | 618 | }]); |
524 | 619 | \ No newline at end of file | ... | ... |
app/partials/analytics/analytics.html
... | ... | @@ -20,10 +20,21 @@ |
20 | 20 | |
21 | 21 | } |
22 | 22 | |
23 | - | |
23 | + .highcharts-button-box{ | |
24 | + display: none; | |
25 | + } | |
26 | + .highcharts-map-navigation{ | |
27 | + background-color: #eee; | |
28 | + border-color: grey; | |
29 | + } | |
24 | 30 | |
25 | - | |
31 | + /*.highcharts-legend{ | |
32 | + transform: unset; | |
33 | + margin-top: 250px; | |
34 | + }*/ | |
35 | +@import 'https://code.highcharts.com/css/themes/sand-signika.css'; | |
26 | 36 | </style> |
37 | + | |
27 | 38 | <div class="main"> |
28 | 39 | <div style="padding: 0 3%; margin-left: 15px;"> |
29 | 40 | <div class="row"> |
... | ... | @@ -140,7 +151,11 @@ |
140 | 151 | </div> |
141 | 152 | <!-- /widget-header --> |
142 | 153 | <div class="widget-content"> |
143 | - <div id="map" style="width: 100%; height: 325px;"></div> | |
154 | + <div ng-show="flag"> | |
155 | + <center><img id="spinner" src="/img/spinner.gif"/></center> | |
156 | + </div> | |
157 | + <!-- <div id="map" style="width: 100%; height: 325px;"></div> --> | |
158 | + <div ng-hide="flag" id="regional-pap" style="height: 400px; min-width: 310px; max-width: 600px; margin: 0 auto"></div> | |
144 | 159 | </div> |
145 | 160 | <!-- /widget-content --> |
146 | 161 | </div> |
... | ... | @@ -176,8 +191,10 @@ |
176 | 191 | </div> |
177 | 192 | </div> |
178 | 193 | </div> |
179 | - <div class="myLoader" ng-show="showLoader"> | |
180 | - <img src="../img/hourglass.gif" width="50px;"> | |
181 | - </div> | |
194 | + | |
182 | 195 | |
183 | 196 | |
197 | + | |
198 | + | |
199 | + | |
200 | + | ... | ... |
app/partials/analytics/analytics.service.js
... | ... | @@ -55,6 +55,7 @@ |
55 | 55 | return deferred.promise; |
56 | 56 | } |
57 | 57 | |
58 | + /* With region Code */ | |
58 | 59 | this.getRPP = function(code){ |
59 | 60 | var deferred = $q.defer(); |
60 | 61 | $http({ |
... | ... | @@ -69,7 +70,22 @@ |
69 | 70 | }) |
70 | 71 | return deferred.promise; |
71 | 72 | } |
72 | - | |
73 | + | |
74 | + /* without region code */ | |
75 | + this.getAllRPP = function(){ | |
76 | + var deferred = $q.defer(); | |
77 | + $http({ | |
78 | + method : 'GET', | |
79 | + url : BASE_URL.url +'/fuelerlinx/getAllRegionalPap' | |
80 | + }) | |
81 | + .then(function (result){ | |
82 | + deferred.resolve(result.data); | |
83 | + },function (result){ | |
84 | + console.log(result) | |
85 | + deferred.resolve(result.data); | |
86 | + }) | |
87 | + return deferred.promise; | |
88 | + } | |
73 | 89 | |
74 | 90 | /*---date filter for Monthly fuel sales chart - dates are sending to the api */ |
75 | 91 | this.getDRFChart = function(fd,td){ | ... | ... |
app/partials/dashboard/dashboard.html
app/partials/main/main.controller.js