Commit bd3a040f8206329d42d206e1ff7086087e42dd21

Authored by Kuldeep Arora
1 parent b944d384c3
Exists in master

Regional Pap pricing UI

app/partials/analytics/analytics.controller.js
1 'use strict'; 1 'use strict';
2 angular.module('acufuel') 2 angular.module('acufuel')
3 .controller('analyticsController', ['$scope','analyticsService',function($scope, analyticsService) { 3 .controller('analyticsController', ['$scope','analyticsService',function($scope,analyticsService) {
4 4
5 $(document).ready(function(){ 5 $(document).ready(function(){
6 $(function(){ 6 $(function(){
7 new jvm.MultiMap({ 7 /*map = new jvm.MultiMap({
8 container: $('#map'), 8 container: $('#map'),
9 maxLevel: 1, 9 maxLevel: 1,
10 main: { 10 main: {
11 map: 'us_lcc', 11 map: 'us_lcc',
12 backgroundColor: '#ffce99', 12 backgroundColor: '#ffce99',
13 }, 13 },
14 mapUrlByCode: function(code, multiMap){ 14 mapUrlByCode: function(code, multiMap){
15 console.log('-----s-----s-s--',code.toLowerCase()) 15 console.log('dddd---',code);
16 console.log('----------',map.getRegionName(code));
17 getRegionPap(label);
16 return '/js/us-counties/jquery-jvectormap-data-'+ 18 return '/js/us-counties/jquery-jvectormap-data-'+
17 code.toLowerCase()+'-'+ 19 code.toLowerCase()+'-'+
18 multiMap.defaultProjection+'-en.js'; 20 multiMap.defaultProjection+'-en.js';
19 }, 21 },
20 onRegionClick:function(event, code) { 22 onRegionClick:function(event, code) {
23 //console.log('----------',map.getRegionName(code));
21 var name = (code); 24 var name = (code);
22 alert(name); 25 alert(name);
23 } 26 }
27 });*/
28
29 jQuery('#map').vectorMap({
30 map: 'us_lcc',
31 backgroundColor: '#ffce99',
32 color: '#dfdfdd',
33 hoverOpacity: 0,
34 selectedColor: '#5f8b98',
35 hoverColor: '#5f8b98',
36 enableZoom: true,
37 showTooltip: true,
38 scaleColors: ['#dfdfdd'],
39 //values: sample_data
40 onRegionClick: function (event, code) {
41 var map = $('#map').vectorMap('get', 'mapObject');
42 var name = map.getRegionName(code);
43 getRegionPap(name);
44 },
45 normalizeFunction: 'polynomial'
24 }); 46 });
25 47
26 }); 48 });
27 }) 49 })
28 50
51 function getRegionPap(code){
52 $scope.showLoader = true;
53 analyticsService.getRPP(code).then(function(result) {
54 $scope.rppData = result;
55 $scope.showLoader = false;
56 $('#popup1').css('display', 'block');
57
58 })
59
60 }
61 $scope.cancelStatus = function() {
62 $('#popup1').css('display', 'none');
63
64 }
65
29 66
30 $scope.drf = {}; 67 $scope.drf = {};
31 $scope.hfp = {}; 68 $scope.hfp = {};
32 $scope.cs = {}; 69 $scope.cs = {};
33 $scope.mfsValues = []; 70 $scope.mfsValues = [];
34 $scope.msfarray=[]; 71 $scope.msfarray=[];
35 $scope.getMFS = function(){ 72 $scope.getMFS = function(){
36 //var makeId = makeId; 73 //var makeId = makeId;
37 analyticsService.getMFS().then(function(result) { 74 analyticsService.getMFS().then(function(result) {
38 $scope.mfsValues = result; 75 $scope.mfsValues = result;
39 76
40 //console.log("msf length",$scope.mfsValues.length); 77 //console.log("msf length",$scope.mfsValues.length);
41 //console.log("mfs data kd--- ",$scope.mfsValues) 78 //console.log("mfs data kd--- ",$scope.mfsValues)
42 79
43 //console.log("==msf data key==",$scope.mfsValues[0].key); 80 //console.log("==msf data key==",$scope.mfsValues[0].key);
44 // console.log("==msf data values==",$scope.mfsValues[0].values); 81 // console.log("==msf data values==",$scope.mfsValues[0].values);
45 // console.log("==x===",$scope.mfsValues[0].values[0].x); 82 // console.log("==x===",$scope.mfsValues[0].values[0].x);
46 //console.log("==y===",$scope.mfsValues[0].values[0].y); 83 //console.log("==y===",$scope.mfsValues[0].values[0].y);
47 // console.log("==x===",$scope.mfsValues[0].values[1].x); 84 // console.log("==x===",$scope.mfsValues[0].values[1].x);
48 // console.log("==y===",$scope.mfsValues[0].values[1].y); 85 // console.log("==y===",$scope.mfsValues[0].values[1].y);
49 /* $scope.optionsmfs = { 86 /* $scope.optionsmfs = {
50 chart: { 87 chart: {
51 type: 'discreteBarChart', 88 type: 'discreteBarChart',
52 height: 450, 89 height: 450,
53 margin : { 90 margin : {
54 top: 20, 91 top: 20,
55 right: 20, 92 right: 20,
56 bottom: 60, 93 bottom: 60,
57 left: 55, 94 left: 55,
58 }, 95 },
59 x: function(d){ return d.label; }, 96 x: function(d){ return d.label; },
60 y: function(d){ return d.value; }, 97 y: function(d){ return d.value; },
61 showValues: false, 98 showValues: false,
62 valueFormat: function(d){ 99 valueFormat: function(d){
63 return d3.format(',.4f')(d); 100 return d3.format(',.4f')(d);
64 }, 101 },
65 transitionDuration: 500, 102 transitionDuration: 500,
66 xAxis: { 103 xAxis: {
67 axisLabel: 'X Axis' 104 axisLabel: 'X Axis'
68 }, 105 },
69 yAxis: { 106 yAxis: {
70 axisLabel: 'Y Axis', 107 axisLabel: 'Y Axis',
71 axisLabelDistance: 30 108 axisLabelDistance: 30
72 } 109 }
73 } 110 }
74 }; 111 };
75 112
76 $scope.datamfs = [{ 113 $scope.datamfs = [{
77 key: "Cumulative Return", 114 key: "Cumulative Return",
78 values: $scope.mfsValues 115 values: $scope.mfsValues
79 }] */ 116 }] */
80 117
81 $scope.optionsmfs = { 118 $scope.optionsmfs = {
82 chart: { 119 chart: {
83 type: 'multiBarChart', 120 type: 'multiBarChart',
84 height: 450, 121 height: 450,
85 margin : { 122 margin : {
86 top: 20, 123 top: 20,
87 right: 20, 124 right: 20,
88 bottom: 45, 125 bottom: 45,
89 left: 45 126 left: 45
90 }, 127 },
91 clipEdge: true, 128 clipEdge: true,
92 //staggerLabels: true, 129 //staggerLabels: true,
93 duration: 500, 130 duration: 500,
94 stacked: true, 131 stacked: true,
95 color: ["#FEDFC3","#990000","#000099","#009900"], 132 color: ["#FEDFC3","#990000","#000099","#009900"],
96 xAxis: { 133 xAxis: {
97 axisLabel: 'Months', 134 axisLabel: 'Months',
98 showMaxMin: false, 135 showMaxMin: false,
99 }, 136 },
100 yAxis: { 137 yAxis: {
101 axisLabel: 'Y Axis', 138 axisLabel: 'Y Axis',
102 axisLabelDistance: -20, 139 axisLabelDistance: -20,
103 tickFormat: function(d){ 140 tickFormat: function(d){
104 return d3.format(',.1f')(d); 141 return d3.format(',.1f')(d);
105 } 142 }
106 } 143 }
107 } 144 }
108 }; 145 };
109 146
110 147
111 //console.log("==length 1==",$scope.mfsValues); 148 //console.log("==length 1==",$scope.mfsValues);
112 149
113 for (var i = 0; i < $scope.mfsValues.length; i++) { 150 for (var i = 0; i < $scope.mfsValues.length; i++) {
114 for(var j=0;j<$scope.mfsValues[i].values.length;j++){ 151 for(var j=0;j<$scope.mfsValues[i].values.length;j++){
115 152
116 $scope.msfarray.push({ 153 $scope.msfarray.push({
117 "key":$scope.mfsValues[i].key, 154 "key":$scope.mfsValues[i].key,
118 "values": [{ 155 "values": [{
119 "x":$scope.mfsValues[i].values[j].x, 156 "x":$scope.mfsValues[i].values[j].x,
120 "y":$scope.mfsValues[i].values[j].y 157 "y":$scope.mfsValues[i].values[j].y
121 }] 158 }]
122 }) 159 })
123 } 160 }
124 161
125 162
126 } 163 }
127 // console.log("new values===",$scope.msfarray); 164 // console.log("new values===",$scope.msfarray);
128 $scope.datamfs=$scope.msfarray; 165 $scope.datamfs=$scope.msfarray;
129 166
130 167
131 /*$scope.datamfs = [{ 168 /*$scope.datamfs = [{
132 "key": "Pending", 169 "key": "Pending",
133 "values": [{ 170 "values": [{
134 "x": "Jan", 171 "x": "Jan",
135 "y": 0.16284738584101344 172 "y": 0.16284738584101344
136 }, { 173 }, {
137 "x": "Feb", 174 "x": "Feb",
138 "y": 2.370283172738109 175 "y": 2.370283172738109
139 }, { 176 }, {
140 "x": "Mar", 177 "x": "Mar",
141 "y": 0.1631208266452718 178 "y": 0.1631208266452718
142 }, { 179 }, {
143 "x": "Apr", 180 "x": "Apr",
144 "y": 0.24609871793543797 181 "y": 0.24609871793543797
145 }, { 182 }, {
146 "x": "May", 183 "x": "May",
147 "y": 1.5096133160633776 184 "y": 1.5096133160633776
148 },{ 185 },{
149 "x": "Jun", 186 "x": "Jun",
150 "y": 0.16284738584101344 187 "y": 0.16284738584101344
151 }, { 188 }, {
152 "x": "Jul", 189 "x": "Jul",
153 "y": 2.370283172738109 190 "y": 2.370283172738109
154 }, { 191 }, {
155 "x": "Aug", 192 "x": "Aug",
156 "y": 0.1631208266452718 193 "y": 0.1631208266452718
157 }, { 194 }, {
158 "x": "Sep", 195 "x": "Sep",
159 "y": 0.24609871793543797 196 "y": 0.24609871793543797
160 }, { 197 }, {
161 "x": "Oct", 198 "x": "Oct",
162 "y": 1.5096133160633776 199 "y": 1.5096133160633776
163 }, { 200 }, {
164 "x": "Nov", 201 "x": "Nov",
165 "y": 0.24609871793543797 202 "y": 0.24609871793543797
166 }, { 203 }, {
167 "x": "Dec", 204 "x": "Dec",
168 "y": 1.5096133160633776 205 "y": 1.5096133160633776
169 }] 206 }]
170 }, { 207 }, {
171 "key": "Cancelled", 208 "key": "Cancelled",
172 "values": [{ 209 "values": [{
173 "x": "Jan", 210 "x": "Jan",
174 "y": 0.12566330679904006 211 "y": 0.12566330679904006
175 }, { 212 }, {
176 "x": "Feb", 213 "x": "Feb",
177 "y": 0.1321859413211272 214 "y": 0.1321859413211272
178 }, { 215 }, {
179 "x": "Mar", 216 "x": "Mar",
180 "y": 1.4798247902549135 217 "y": 1.4798247902549135
181 }, { 218 }, {
182 "x": "Apr", 219 "x": "Apr",
183 "y": 0.10870538273358979 220 "y": 0.10870538273358979
184 }, { 221 }, {
185 "x": "May", 222 "x": "May",
186 "y": 0.16155091711225184 223 "y": 0.16155091711225184
187 },{ 224 },{
188 "x": "Jun", 225 "x": "Jun",
189 "y": 0.16284738584101344 226 "y": 0.16284738584101344
190 }, { 227 }, {
191 "x": "Jul", 228 "x": "Jul",
192 "y": 2.370283172738109 229 "y": 2.370283172738109
193 }, { 230 }, {
194 "x": "Aug", 231 "x": "Aug",
195 "y": 0.1631208266452718 232 "y": 0.1631208266452718
196 }, { 233 }, {
197 "x": "Sep", 234 "x": "Sep",
198 "y": 0.24609871793543797 235 "y": 0.24609871793543797
199 }, { 236 }, {
200 "x": "Oct", 237 "x": "Oct",
201 "y": 1.5096133160633776 238 "y": 1.5096133160633776
202 }, { 239 }, {
203 "x": "Nov", 240 "x": "Nov",
204 "y": 0.24609871793543797 241 "y": 0.24609871793543797
205 }, { 242 }, {
206 "x": "Dec", 243 "x": "Dec",
207 "y": 1.5096133160633776 244 "y": 1.5096133160633776
208 }] 245 }]
209 },{ 246 },{
210 "key": "Invoiced", 247 "key": "Invoiced",
211 "values": [{ 248 "values": [{
212 "x": "Jan", 249 "x": "Jan",
213 "y": 0.16284738584101344 250 "y": 0.16284738584101344
214 }, { 251 }, {
215 "x": "Feb", 252 "x": "Feb",
216 "y": 2.370283172738109 253 "y": 2.370283172738109
217 }, { 254 }, {
218 "x": "Mar", 255 "x": "Mar",
219 "y": 0.1631208266452718 256 "y": 0.1631208266452718
220 }, { 257 }, {
221 "x": "Apr", 258 "x": "Apr",
222 "y": 0.24609871793543797 259 "y": 0.24609871793543797
223 }, { 260 }, {
224 "x": "May", 261 "x": "May",
225 "y": 1.5096133160633776 262 "y": 1.5096133160633776
226 },{ 263 },{
227 "x": "Jun", 264 "x": "Jun",
228 "y": 0.16284738584101344 265 "y": 0.16284738584101344
229 }, { 266 }, {
230 "x": "Jul", 267 "x": "Jul",
231 "y": 2.370283172738109 268 "y": 2.370283172738109
232 }, { 269 }, {
233 "x": "Aug", 270 "x": "Aug",
234 "y": 0.1631208266452718 271 "y": 0.1631208266452718
235 }, { 272 }, {
236 "x": "Sep", 273 "x": "Sep",
237 "y": 0.24609871793543797 274 "y": 0.24609871793543797
238 }, { 275 }, {
239 "x": "Oct", 276 "x": "Oct",
240 "y": 1.5096133160633776 277 "y": 1.5096133160633776
241 }, { 278 }, {
242 "x": "Nov", 279 "x": "Nov",
243 "y": 0.24609871793543797 280 "y": 0.24609871793543797
244 }, { 281 }, {
245 "x": "Dec", 282 "x": "Dec",
246 "y": 1.5096133160633776 283 "y": 1.5096133160633776
247 }] 284 }]
248 }, { 285 }, {
249 "key": "Paid", 286 "key": "Paid",
250 "values": [{ 287 "values": [{
251 "x": "Jan", 288 "x": "Jan",
252 "y": 0.12566330679904006 289 "y": 0.12566330679904006
253 }, { 290 }, {
254 "x": "Feb", 291 "x": "Feb",
255 "y": 0.1321859413211272 292 "y": 0.1321859413211272
256 }, { 293 }, {
257 "x": "Mar", 294 "x": "Mar",
258 "y": 1.4798247902549135 295 "y": 1.4798247902549135
259 }, { 296 }, {
260 "x": "Apr", 297 "x": "Apr",
261 "y": 0.10870538273358979 298 "y": 0.10870538273358979
262 }, { 299 }, {
263 "x": "May", 300 "x": "May",
264 "y": 0.16155091711225184 301 "y": 0.16155091711225184
265 },{ 302 },{
266 "x": "Jun", 303 "x": "Jun",
267 "y": 0.16284738584101344 304 "y": 0.16284738584101344
268 }, { 305 }, {
269 "x": "Jul", 306 "x": "Jul",
270 "y": 2.370283172738109 307 "y": 2.370283172738109
271 }, { 308 }, {
272 "x": "Aug", 309 "x": "Aug",
273 "y": 0.1631208266452718 310 "y": 0.1631208266452718
274 }, { 311 }, {
275 "x": "Sep", 312 "x": "Sep",
276 "y": 0.24609871793543797 313 "y": 0.24609871793543797
277 }, { 314 }, {
278 "x": "Oct", 315 "x": "Oct",
279 "y": 1.5096133160633776 316 "y": 1.5096133160633776
280 }, { 317 }, {
281 "x": "Nov", 318 "x": "Nov",
282 "y": 0.24609871793543797 319 "y": 0.24609871793543797
283 }, { 320 }, {
284 "x": "Dec", 321 "x": "Dec",
285 "y": 1.5096133160633776 322 "y": 1.5096133160633776
286 }] 323 }]
287 }] 324 }]
288 */ 325 */
289 }) 326 })
290 } 327 }
291 328
292 329
293 330
294 331
295 $scope.getMFS(); 332 $scope.getMFS();
296 $scope.csValues = []; 333 $scope.csValues = [];
297 $scope.getCS = function(){ 334 $scope.getCS = function(){
298 //var makeId = makeId; 335 //var makeId = makeId;
299 analyticsService.getCS().then(function(result) { 336 analyticsService.getCS().then(function(result) {
300 console.log("==cs values==",result) 337 //console.log("==cs values==",result)
301 $scope.csValues = result; 338 $scope.csValues = result;
302 //console.log("cs data kd --- ",$scope.csValues) 339 //console.log("cs data kd --- ",$scope.csValues)
303 $scope.optionscs = { 340 $scope.optionscs = {
304 chart: { 341 chart: {
305 type: 'pieChart', 342 type: 'pieChart',
306 height: 500, 343 height: 500,
307 // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"], 344 // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"],
308 x: function(d){return d.key;}, 345 x: function(d){return d.key;},
309 y: function(d){return d.y;}, 346 y: function(d){return d.y;},
310 showLabels: false, 347 showLabels: false,
311 segmentShowStroke : false, 348 segmentShowStroke : false,
312 animationSteps : 20, 349 animationSteps : 20,
313 animationEasing : "linear", 350 animationEasing : "linear",
314 animateScale : true, 351 animateScale : true,
315 duration: 500, 352 duration: 500,
316 labelThreshold: 0.01, 353 labelThreshold: 0.01,
317 labelSunbeamLayout: true, 354 labelSunbeamLayout: true,
318 legend: { 355 legend: {
319 margin: { 356 margin: {
320 top: 5, 357 top: 5,
321 right: 35, 358 right: 35,
322 bottom: 5, 359 bottom: 5,
323 left: 0 360 left: 0
324 } 361 }
325 } 362 }
326 } 363 }
327 }; 364 };
328 $scope.datacs = $scope.csValues; 365 $scope.datacs = $scope.csValues;
329 }) 366 })
330 } 367 }
331 368
332 $scope.getCS(); 369 $scope.getCS();
333 370
334 /*Historic Fuel Price */ 371 /*Historic Fuel Price */
335 $scope.optionshfp = { 372 $scope.optionshfp = {
336 chart: { 373 chart: {
337 type: 'cumulativeLineChart', 374 type: 'cumulativeLineChart',
338 height: 450, 375 height: 450,
339 margin : { 376 margin : {
340 top: 20, 377 top: 20,
341 right: 20, 378 right: 20,
342 bottom: 50, 379 bottom: 50,
343 left: 65 380 left: 65
344 }, 381 },
345 x: function(d){ return d[0]; }, 382 x: function(d){ return d[0]; },
346 y: function(d){ return d[1]/100; }, 383 y: function(d){ return d[1]/100; },
347 average: function(d) { return d.mean/100; }, 384 average: function(d) { return d.mean/100; },
348 385
349 color: ["#FEDFC3"], 386 color: ["#FEDFC3"],
350 duration: 300, 387 duration: 300,
351 useInteractiveGuideline: true, 388 useInteractiveGuideline: true,
352 clipVoronoi: false, 389 clipVoronoi: false,
353 390
354 xAxis: { 391 xAxis: {
355 axisLabel: 'X Axis', 392 axisLabel: 'X Axis',
356 tickFormat: function(d) { 393 tickFormat: function(d) {
357 return d3.time.format('%m/%d/%y')(new Date(d)) 394 return d3.time.format('%m/%d/%y')(new Date(d))
358 }, 395 },
359 showMaxMin: false, 396 showMaxMin: false,
360 staggerLabels: true 397 staggerLabels: true
361 }, 398 },
362 399
363 yAxis: { 400 yAxis: {
364 axisLabel: 'Y Axis', 401 axisLabel: 'Y Axis',
365 tickFormat: function(d){ 402 tickFormat: function(d){
366 return d3.format(',.1%')(d); 403 return d3.format(',.1%')(d);
367 }, 404 },
368 axisLabelDistance: 0 405 axisLabelDistance: 0
369 } 406 }
370 } 407 }
371 }; 408 };
372 409
373 $scope.datahfp = 410 $scope.datahfp =
374 [{ 411 [{
375 key: "Long", 412 key: "Long",
376 values: [ [ 1083297600000 , -2.974623048543] , [ 1085976000000 , -1.7740300785979] , [ 1088568000000 , 4.4681318138177] , [ 1091246400000 , 7.0242541001353] , [ 1093924800000 , 7.5709603667586] , [ 1096516800000 , 20.612245065736] , [ 1099195200000 , 21.698065237316] , [ 1101790800000 , 40.501189458018] , [ 1104469200000 , 50.464679413194] , [ 1107147600000 , 48.917421973355] , [ 1109566800000 , 63.750936549160] , [ 1112245200000 , 59.072499126460] , [ 1114833600000 , 43.373158880492] , [ 1117512000000 , 54.490918947556] , [ 1120104000000 , 56.661178852079] , [ 1122782400000 , 73.450103545496] , [ 1125460800000 , 71.714526354907] , [ 1128052800000 , 85.221664349607] , [ 1130734800000 , 77.769261392481] , [ 1133326800000 , 95.966528716500] , [ 1136005200000 , 107.59132116397] , [ 1138683600000 , 127.25740096723] , [ 1141102800000 , 122.13917498830] , [ 1143781200000 , 126.53657279774] , [ 1146369600000 , 132.39300992970] , [ 1149048000000 , 120.11238242904] , [ 1151640000000 , 118.41408917750] , [ 1154318400000 , 107.92918924621] , [ 1156996800000 , 110.28057249569] , [ 1159588800000 , 117.20485334692] , [ 1162270800000 , 141.33556756948] , [ 1164862800000 , 159.59452727893] , [ 1167541200000 , 167.09801853304] , [ 1170219600000 , 185.46849659215] , [ 1172638800000 , 184.82474099990] , [ 1175313600000 , 195.63155213887] , [ 1177905600000 , 207.40597044171] , [ 1180584000000 , 230.55966698196] , [ 1183176000000 , 239.55649035292] , [ 1185854400000 , 241.35915085208] , [ 1188532800000 , 239.89428956243] , [ 1191124800000 , 260.47781917715] , [ 1193803200000 , 276.39457482225] , [ 1196398800000 , 258.66530682672] , [ 1199077200000 , 250.98846121893] , [ 1201755600000 , 226.89902618127] , [ 1204261200000 , 227.29009273807] , [ 1206936000000 , 218.66476654350] , [ 1209528000000 , 232.46605902918] , [ 1212206400000 , 253.25667081117] , [ 1214798400000 , 235.82505363925] , [ 1217476800000 , 229.70112774254] , [ 1220155200000 , 225.18472705952] , [ 1222747200000 , 189.13661746552] , [ 1225425600000 , 149.46533007301] , [ 1228021200000 , 131.00340772114] , [ 1230699600000 , 135.18341728866] , [ 1233378000000 , 109.15296887173] , [ 1235797200000 , 84.614772549760] , [ 1238472000000 , 100.60810015326] , [ 1241064000000 , 141.50134895610] , [ 1243742400000 , 142.50405083675] , [ 1246334400000 , 139.81192372672] , [ 1249012800000 , 177.78205544583] , [ 1251691200000 , 194.73691933074] , [ 1254283200000 , 209.00838460225] , [ 1256961600000 , 198.19855877420] , [ 1259557200000 , 222.37102417812] , [ 1262235600000 , 234.24581081250] , [ 1264914000000 , 228.26087689346] , [ 1267333200000 , 248.81895126250] , [ 1270008000000 , 270.57301075186] , [ 1272600000000 , 292.64604322550] , [ 1275278400000 , 265.94088520518] , [ 1277870400000 , 237.82887467569] , [ 1280548800000 , 265.55973314204] , [ 1283227200000 , 248.30877330928] , [ 1285819200000 , 278.14870066912] , [ 1288497600000 , 292.69260960288] , [ 1291093200000 , 300.84263809599] , [ 1293771600000 , 326.17253914628] , [ 1296450000000 , 337.69335966505] , [ 1298869200000 , 339.73260965121] , [ 1301544000000 , 346.87865120765] , [ 1304136000000 , 347.92991526628] , [ 1306814400000 , 342.04627502669] , [ 1309406400000 , 333.45386231233] , [ 1312084800000 , 323.15034181243] , [ 1314763200000 , 295.66126882331] , [ 1317355200000 , 251.48014579253] , [ 1320033600000 , 295.15424257905] , [ 1322629200000 , 294.54766764397] , [ 1325307600000 , 295.72906119051] , [ 1327986000000 , 325.73351347613] , [ 1330491600000 , 340.16106061186] , [ 1333166400000 , 345.15514071490] , [ 1335758400000 , 337.10259395679] , [ 1338436800000 , 318.68216333837] , [ 1341028800000 , 317.03683945246] , [ 1343707200000 , 318.53549659997] , [ 1346385600000 , 332.85381464104] , [ 1348977600000 , 337.36534373477] , [ 1351656000000 , 350.27872156161] , [ 1354251600000 , 349.45128876100]] 413 values: [ [ 1083297600000 , -2.974623048543] , [ 1085976000000 , -1.7740300785979] , [ 1088568000000 , 4.4681318138177] , [ 1091246400000 , 7.0242541001353] , [ 1093924800000 , 7.5709603667586] , [ 1096516800000 , 20.612245065736] , [ 1099195200000 , 21.698065237316] , [ 1101790800000 , 40.501189458018] , [ 1104469200000 , 50.464679413194] , [ 1107147600000 , 48.917421973355] , [ 1109566800000 , 63.750936549160] , [ 1112245200000 , 59.072499126460] , [ 1114833600000 , 43.373158880492] , [ 1117512000000 , 54.490918947556] , [ 1120104000000 , 56.661178852079] , [ 1122782400000 , 73.450103545496] , [ 1125460800000 , 71.714526354907] , [ 1128052800000 , 85.221664349607] , [ 1130734800000 , 77.769261392481] , [ 1133326800000 , 95.966528716500] , [ 1136005200000 , 107.59132116397] , [ 1138683600000 , 127.25740096723] , [ 1141102800000 , 122.13917498830] , [ 1143781200000 , 126.53657279774] , [ 1146369600000 , 132.39300992970] , [ 1149048000000 , 120.11238242904] , [ 1151640000000 , 118.41408917750] , [ 1154318400000 , 107.92918924621] , [ 1156996800000 , 110.28057249569] , [ 1159588800000 , 117.20485334692] , [ 1162270800000 , 141.33556756948] , [ 1164862800000 , 159.59452727893] , [ 1167541200000 , 167.09801853304] , [ 1170219600000 , 185.46849659215] , [ 1172638800000 , 184.82474099990] , [ 1175313600000 , 195.63155213887] , [ 1177905600000 , 207.40597044171] , [ 1180584000000 , 230.55966698196] , [ 1183176000000 , 239.55649035292] , [ 1185854400000 , 241.35915085208] , [ 1188532800000 , 239.89428956243] , [ 1191124800000 , 260.47781917715] , [ 1193803200000 , 276.39457482225] , [ 1196398800000 , 258.66530682672] , [ 1199077200000 , 250.98846121893] , [ 1201755600000 , 226.89902618127] , [ 1204261200000 , 227.29009273807] , [ 1206936000000 , 218.66476654350] , [ 1209528000000 , 232.46605902918] , [ 1212206400000 , 253.25667081117] , [ 1214798400000 , 235.82505363925] , [ 1217476800000 , 229.70112774254] , [ 1220155200000 , 225.18472705952] , [ 1222747200000 , 189.13661746552] , [ 1225425600000 , 149.46533007301] , [ 1228021200000 , 131.00340772114] , [ 1230699600000 , 135.18341728866] , [ 1233378000000 , 109.15296887173] , [ 1235797200000 , 84.614772549760] , [ 1238472000000 , 100.60810015326] , [ 1241064000000 , 141.50134895610] , [ 1243742400000 , 142.50405083675] , [ 1246334400000 , 139.81192372672] , [ 1249012800000 , 177.78205544583] , [ 1251691200000 , 194.73691933074] , [ 1254283200000 , 209.00838460225] , [ 1256961600000 , 198.19855877420] , [ 1259557200000 , 222.37102417812] , [ 1262235600000 , 234.24581081250] , [ 1264914000000 , 228.26087689346] , [ 1267333200000 , 248.81895126250] , [ 1270008000000 , 270.57301075186] , [ 1272600000000 , 292.64604322550] , [ 1275278400000 , 265.94088520518] , [ 1277870400000 , 237.82887467569] , [ 1280548800000 , 265.55973314204] , [ 1283227200000 , 248.30877330928] , [ 1285819200000 , 278.14870066912] , [ 1288497600000 , 292.69260960288] , [ 1291093200000 , 300.84263809599] , [ 1293771600000 , 326.17253914628] , [ 1296450000000 , 337.69335966505] , [ 1298869200000 , 339.73260965121] , [ 1301544000000 , 346.87865120765] , [ 1304136000000 , 347.92991526628] , [ 1306814400000 , 342.04627502669] , [ 1309406400000 , 333.45386231233] , [ 1312084800000 , 323.15034181243] , [ 1314763200000 , 295.66126882331] , [ 1317355200000 , 251.48014579253] , [ 1320033600000 , 295.15424257905] , [ 1322629200000 , 294.54766764397] , [ 1325307600000 , 295.72906119051] , [ 1327986000000 , 325.73351347613] , [ 1330491600000 , 340.16106061186] , [ 1333166400000 , 345.15514071490] , [ 1335758400000 , 337.10259395679] , [ 1338436800000 , 318.68216333837] , [ 1341028800000 , 317.03683945246] , [ 1343707200000 , 318.53549659997] , [ 1346385600000 , 332.85381464104] , [ 1348977600000 , 337.36534373477] , [ 1351656000000 , 350.27872156161] , [ 1354251600000 , 349.45128876100]]
377 , 414 ,
378 mean: 250 415 mean: 250
379 }]; 416 }];
380 //console.log("--datahfp---",$scope.datahfp); 417 //console.log("--datahfp---",$scope.datahfp);
381 418
382 419
383 /*Date Range Filter for Monthly fuel Sales*/ 420 /*Date Range Filter for Monthly fuel Sales*/
384 $scope.submitDate = function(){ 421 $scope.submitDate = function(){
385 422
386 if ($scope.drf.fromDate === undefined) { 423 if ($scope.drf.fromDate === undefined) {
387 424
388 // console.log("==frmdate====",$scope.drf.fromDate); 425 // console.log("==frmdate====",$scope.drf.fromDate);
389 //console.log("==toDate====",$scope.drf.toDate); 426 //console.log("==toDate====",$scope.drf.toDate);
390 $scope.fillForm = true; 427 $scope.fillForm = true;
391 } 428 }
392 else if($scope.drf.fromDate != undefined && $scope.drf.toDate === undefined || $scope.drf.toDate ===''){ 429 else if($scope.drf.fromDate != undefined && $scope.drf.toDate === undefined || $scope.drf.toDate ===''){
393 $scope.fillForm = false; 430 $scope.fillForm = false;
394 var today= new Date(); 431 var today= new Date();
395 var DefaultToDate= today.getFullYear()+'-'+("0" + (today.getMonth() + 1)).slice(-2)+'-'+("0" + today.getDate()).slice(-2); 432 var DefaultToDate= today.getFullYear()+'-'+("0" + (today.getMonth() + 1)).slice(-2)+'-'+("0" + today.getDate()).slice(-2);
396 //from date format 433 //from date format
397 $scope.dat1 = $scope.drf.fromDate; 434 $scope.dat1 = $scope.drf.fromDate;
398 $scope.fd1 = $scope.dat1.split("/").reverse(); 435 $scope.fd1 = $scope.dat1.split("/").reverse();
399 $scope.tmp = $scope.fd1[2]; 436 $scope.tmp = $scope.fd1[2];
400 $scope.fd1[2] = $scope.fd1[1]; 437 $scope.fd1[2] = $scope.fd1[1];
401 $scope.fd1[1] = $scope.tmp; 438 $scope.fd1[1] = $scope.tmp;
402 $scope.fd = $scope.fd1.join("-"); 439 $scope.fd = $scope.fd1.join("-");
403 // console.log("===fd====",$scope.fd); 440 // console.log("===fd====",$scope.fd);
404 //console.log("----td curr---",DefaultToDate); 441 //console.log("----td curr---",DefaultToDate);
405 analyticsService.getDRFChart($scope.fd,DefaultToDate).then(function(result) { 442 analyticsService.getDRFChart($scope.fd,DefaultToDate).then(function(result) {
406 //console.log("==date received==",$scope.fd); 443 //console.log("==date received==",$scope.fd);
407 //console.log("----to date receivedcurrent---",DefaultToDate) 444 //console.log("----to date receivedcurrent---",DefaultToDate)
408 $scope.datamfs = result; 445 $scope.datamfs = result;
409 }) 446 })
410 447
411 448
412 } else if($scope.drf.fromDate != undefined && $scope.drf.toDate != undefined ){ 449 } else if($scope.drf.fromDate != undefined && $scope.drf.toDate != undefined ){
413 $scope.fillForm = false; 450 $scope.fillForm = false;
414 //from date format 451 //from date format
415 $scope.dat1 = $scope.drf.fromDate; 452 $scope.dat1 = $scope.drf.fromDate;
416 $scope.fd1 = $scope.dat1.split("/").reverse(); 453 $scope.fd1 = $scope.dat1.split("/").reverse();
417 $scope.tmp = $scope.fd1[2]; 454 $scope.tmp = $scope.fd1[2];
418 $scope.fd1[2] = $scope.fd1[1]; 455 $scope.fd1[2] = $scope.fd1[1];
419 $scope.fd1[1] = $scope.tmp; 456 $scope.fd1[1] = $scope.tmp;
420 $scope.fd = $scope.fd1.join("-"); 457 $scope.fd = $scope.fd1.join("-");
421 //to date format 458 //to date format
422 $scope.dat2 = $scope.drf.toDate; 459 $scope.dat2 = $scope.drf.toDate;
423 $scope.td1 = $scope.dat2.split("/").reverse(); 460 $scope.td1 = $scope.dat2.split("/").reverse();
424 $scope.tmp1 = $scope.td1[2]; 461 $scope.tmp1 = $scope.td1[2];
425 $scope.td1[2] = $scope.td1[1]; 462 $scope.td1[2] = $scope.td1[1];
426 $scope.td1[1] = $scope.tmp1; 463 $scope.td1[1] = $scope.tmp1;
427 $scope.td = $scope.td1.join("-"); 464 $scope.td = $scope.td1.join("-");
428 465
429 analyticsService.getDRFChart($scope.fd,$scope.td).then(function(result) { 466 analyticsService.getDRFChart($scope.fd,$scope.td).then(function(result) {
430 // console.log("==date received==",$scope.fd); 467 // console.log("==date received==",$scope.fd);
431 //console.log("----to date received---",$scope.td) 468 //console.log("----to date received---",$scope.td)
432 $scope.datamfs = result; 469 $scope.datamfs = result;
433 }) 470 })
434 471
435 }else 472 }else
436 { 473 {
437 $scope.fillForm = true; 474 $scope.fillForm = true;
438 } 475 }
439 476
440 477
441 } 478 }
442 479
443 /*Date Range Filter for Historic fuel Price*/ 480 /*Date Range Filter for Historic fuel Price*/
444 $scope.submitDateHfp = function(){ 481 $scope.submitDateHfp = function(){
445 482
446 if ($scope.hfp.fromDate === undefined) { 483 if ($scope.hfp.fromDate === undefined) {
447 484
448 // console.log("==frmdate====",$scope.drf.fromDate); 485 // console.log("==frmdate====",$scope.drf.fromDate);
449 //console.log("==toDate====",$scope.drf.toDate); 486 //console.log("==toDate====",$scope.drf.toDate);
450 $scope.fillForm = true; 487 $scope.fillForm = true;
451 } 488 }
452 else if($scope.hfp.fromDate != undefined && $scope.hfp.toDate === undefined || $scope.hfp.toDate ===''){ 489 else if($scope.hfp.fromDate != undefined && $scope.hfp.toDate === undefined || $scope.hfp.toDate ===''){
453 $scope.fillForm = false; 490 $scope.fillForm = false;
454 var today= new Date(); 491 var today= new Date();
455 var DefaultToDate= today.getFullYear()+'-'+("0" + (today.getMonth() + 1)).slice(-2)+'-'+("0" + today.getDate()).slice(-2); 492 var DefaultToDate= today.getFullYear()+'-'+("0" + (today.getMonth() + 1)).slice(-2)+'-'+("0" + today.getDate()).slice(-2);
456 //from date format 493 //from date format
457 $scope.dat1 = $scope.hfp.fromDate; 494 $scope.dat1 = $scope.hfp.fromDate;
458 $scope.fd1 = $scope.dat1.split("/").reverse(); 495 $scope.fd1 = $scope.dat1.split("/").reverse();
459 $scope.tmp = $scope.fd1[2]; 496 $scope.tmp = $scope.fd1[2];
460 $scope.fd1[2] = $scope.fd1[1]; 497 $scope.fd1[2] = $scope.fd1[1];
461 $scope.fd1[1] = $scope.tmp; 498 $scope.fd1[1] = $scope.tmp;
462 $scope.fd = $scope.fd1.join("-"); 499 $scope.fd = $scope.fd1.join("-");
463 // console.log("===fd====",$scope.fd); 500 // console.log("===fd====",$scope.fd);
464 //console.log("----td curr---",DefaultToDate); 501 //console.log("----td curr---",DefaultToDate);
465 analyticsService.getDRFHfpChart($scope.fd,DefaultToDate).then(function(result) { 502 analyticsService.getDRFHfpChart($scope.fd,DefaultToDate).then(function(result) {
466 //console.log("==date received==",$scope.fd); 503 //console.log("==date received==",$scope.fd);
467 //console.log("----to date receivedcurrent---",DefaultToDate) 504 //console.log("----to date receivedcurrent---",DefaultToDate)
468 $scope.datahfp = result; 505 $scope.datahfp = result;
469 }) 506 })
470 507
471 508
472 } else if($scope.hfp.fromDate != undefined && $scope.hfp.toDate != undefined ){ 509 } else if($scope.hfp.fromDate != undefined && $scope.hfp.toDate != undefined ){
473 $scope.fillForm = false; 510 $scope.fillForm = false;
474 //from date format 511 //from date format
475 $scope.dat1 = $scope.hfp.fromDate; 512 $scope.dat1 = $scope.hfp.fromDate;
476 $scope.fd1 = $scope.dat1.split("/").reverse(); 513 $scope.fd1 = $scope.dat1.split("/").reverse();
477 $scope.tmp = $scope.fd1[2]; 514 $scope.tmp = $scope.fd1[2];
478 $scope.fd1[2] = $scope.fd1[1]; 515 $scope.fd1[2] = $scope.fd1[1];
479 $scope.fd1[1] = $scope.tmp; 516 $scope.fd1[1] = $scope.tmp;
480 $scope.fd = $scope.fd1.join("-"); 517 $scope.fd = $scope.fd1.join("-");
481 //to date format 518 //to date format
482 $scope.dat2 = $scope.hfp.toDate; 519 $scope.dat2 = $scope.hfp.toDate;
483 $scope.td1 = $scope.dat2.split("/").reverse(); 520 $scope.td1 = $scope.dat2.split("/").reverse();
484 $scope.tmp1 = $scope.td1[2]; 521 $scope.tmp1 = $scope.td1[2];
485 $scope.td1[2] = $scope.td1[1]; 522 $scope.td1[2] = $scope.td1[1];
486 $scope.td1[1] = $scope.tmp1; 523 $scope.td1[1] = $scope.tmp1;
487 $scope.td = $scope.td1.join("-"); 524 $scope.td = $scope.td1.join("-");
488 525
489 analyticsService.getDRFHfpChart($scope.fd,$scope.td).then(function(result) { 526 analyticsService.getDRFHfpChart($scope.fd,$scope.td).then(function(result) {
490 // console.log("==date received==",$scope.fd); 527 // console.log("==date received==",$scope.fd);
491 //console.log("----to date received---",$scope.td) 528 //console.log("----to date received---",$scope.td)
492 $scope.datahfp = result; 529 $scope.datahfp = result;
493 }) 530 })
494 531
495 }else 532 }else
496 { 533 {
497 $scope.fillForm = true; 534 $scope.fillForm = true;
498 } 535 }
499 536
500 537
501 } 538 }
502 539
503 /*Date Range Filter for Customer Sources*/ 540 /*Date Range Filter for Customer Sources*/
504 $scope.submitDateCs = function(){ 541 $scope.submitDateCs = function(){
505 console.log("==fromdate===",$scope.cs.fromDate)
506 console.log("====todate=====",$scope.cs.toDate)
507
508 if ($scope.cs.fromDate === undefined) { 542 if ($scope.cs.fromDate === undefined) {
509 543
510 $scope.fillForm = true; 544 $scope.fillForm = true;
511 } 545 }
512 else if($scope.cs.fromDate != undefined && $scope.cs.toDate === undefined || $scope.cs.toDate ===''){ 546 else if($scope.cs.fromDate != undefined && $scope.cs.toDate === undefined || $scope.cs.toDate ===''){
513 $scope.fillForm = false; 547 $scope.fillForm = false;
514 var today= new Date(); 548 var today= new Date();
515 var DefaultToDate= today.getFullYear()+'-'+("0" + (today.getMonth() + 1)).slice(-2)+'-'+("0" + today.getDate()).slice(-2); 549 var DefaultToDate= today.getFullYear()+'-'+("0" + (today.getMonth() + 1)).slice(-2)+'-'+("0" + today.getDate()).slice(-2);
516 //from date format 550 //from date format
517 $scope.dat1 = $scope.cs.fromDate; 551 $scope.dat1 = $scope.cs.fromDate;
518 $scope.fd1 = $scope.dat1.split("/").reverse(); 552 $scope.fd1 = $scope.dat1.split("/").reverse();
519 $scope.tmp = $scope.fd1[2]; 553 $scope.tmp = $scope.fd1[2];
520 $scope.fd1[2] = $scope.fd1[1]; 554 $scope.fd1[2] = $scope.fd1[1];
521 $scope.fd1[1] = $scope.tmp; 555 $scope.fd1[1] = $scope.tmp;
522 $scope.fd = $scope.fd1.join("-"); 556 $scope.fd = $scope.fd1.join("-");
523 analyticsService.getDRFCSChart($scope.fd,DefaultToDate).then(function(result) { 557 analyticsService.getDRFCSChart($scope.fd,DefaultToDate).then(function(result) {
524 $scope.csValues = result; 558 $scope.csValues = result;
525 $scope.optionscs = { 559 $scope.optionscs = {
526 chart: { 560 chart: {
527 type: 'pieChart', 561 type: 'pieChart',
528 height: 500, 562 height: 500,
529 // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"], 563 // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"],
530 x: function(d){return d.key;}, 564 x: function(d){return d.key;},
531 y: function(d){return d.y;}, 565 y: function(d){return d.y;},
532 showLabels: false, 566 showLabels: false,
533 segmentShowStroke : false, 567 segmentShowStroke : false,
534 animationSteps : 20, 568 animationSteps : 20,
535 animationEasing : "linear", 569 animationEasing : "linear",
536 animateScale : true, 570 animateScale : true,
537 duration: 500, 571 duration: 500,
538 labelThreshold: 0.01, 572 labelThreshold: 0.01,
539 labelSunbeamLayout: true, 573 labelSunbeamLayout: true,
540 legend: { 574 legend: {
541 margin: { 575 margin: {
542 top: 5, 576 top: 5,
543 right: 35, 577 right: 35,
544 bottom: 5, 578 bottom: 5,
545 left: 0 579 left: 0
546 } 580 }
547 } 581 }
548 } 582 }
549 }; 583 };
550 $scope.datacs = $scope.csValues; 584 $scope.datacs = $scope.csValues;
551 }) 585 })
552 586
553 587
554 } else if($scope.cs.fromDate != undefined && $scope.cs.toDate != undefined ){ 588 } else if($scope.cs.fromDate != undefined && $scope.cs.toDate != undefined ){
555 $scope.fillForm = false; 589 $scope.fillForm = false;
556 //from date format 590 //from date format
557 $scope.dat1 = $scope.cs.fromDate; 591 $scope.dat1 = $scope.cs.fromDate;
558 $scope.fd1 = $scope.dat1.split("/").reverse(); 592 $scope.fd1 = $scope.dat1.split("/").reverse();
559 $scope.tmp = $scope.fd1[2]; 593 $scope.tmp = $scope.fd1[2];
560 $scope.fd1[2] = $scope.fd1[1]; 594 $scope.fd1[2] = $scope.fd1[1];
561 $scope.fd1[1] = $scope.tmp; 595 $scope.fd1[1] = $scope.tmp;
562 $scope.fd = $scope.fd1.join("-"); 596 $scope.fd = $scope.fd1.join("-");
563 //to date format 597 //to date format
564 $scope.dat2 = $scope.cs.toDate; 598 $scope.dat2 = $scope.cs.toDate;
565 $scope.td1 = $scope.dat2.split("/").reverse(); 599 $scope.td1 = $scope.dat2.split("/").reverse();
566 $scope.tmp1 = $scope.td1[2]; 600 $scope.tmp1 = $scope.td1[2];
567 $scope.td1[2] = $scope.td1[1]; 601 $scope.td1[2] = $scope.td1[1];
568 $scope.td1[1] = $scope.tmp1; 602 $scope.td1[1] = $scope.tmp1;
569 $scope.td = $scope.td1.join("-"); 603 $scope.td = $scope.td1.join("-");
570 604
571 analyticsService.getDRFCSChart($scope.fd,$scope.td).then(function(result) { 605 analyticsService.getDRFCSChart($scope.fd,$scope.td).then(function(result) {
572 $scope.csValues = result; 606 $scope.csValues = result;
573 $scope.optionscs = { 607 $scope.optionscs = {
574 chart: { 608 chart: {
575 type: 'pieChart', 609 type: 'pieChart',
576 height: 500, 610 height: 500,
577 // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"], 611 // color: ["#FEDFC3","#D89700","#FFE8B3","FFD980","#FF7F0E","#fff2e6","#ffcc99","#ffa64d","#ff8c1a","#B37D00","#f5f5f0","#e0e0d1","#ccccb3","#adad85","#999966","#7a7a52"],
578 x: function(d){return d.key;}, 612 x: function(d){return d.key;},
579 y: function(d){return d.y;}, 613 y: function(d){return d.y;},
580 showLabels: false, 614 showLabels: false,
581 segmentShowStroke : false, 615 segmentShowStroke : false,
582 animationSteps : 20, 616 animationSteps : 20,
583 animationEasing : "linear", 617 animationEasing : "linear",
584 animateScale : true, 618 animateScale : true,
585 duration: 500, 619 duration: 500,
586 labelThreshold: 0.01, 620 labelThreshold: 0.01,
587 labelSunbeamLayout: true, 621 labelSunbeamLayout: true,
588 legend: { 622 legend: {
589 margin: { 623 margin: {
590 top: 5, 624 top: 5,
591 right: 35, 625 right: 35,
592 bottom: 5, 626 bottom: 5,
593 left: 0 627 left: 0
594 } 628 }
595 } 629 }
596 } 630 }
597 }; 631 };
598 $scope.datacs = $scope.csValues; 632 $scope.datacs = $scope.csValues;
599 }) 633 })
600 634
601 }else 635 }else
602 { 636 {
603 $scope.fillForm = true; 637 $scope.fillForm = true;
604 } 638 }
605 639
606 640
607 } 641 }
608 642
609 643
610 644
611 }]); 645 }]);
app/partials/analytics/analytics.html
1 <style> 1 <style>
2 .chart-holder { 2 .chart-holder {
3 height: 325px; 3 height: 325px;
4 } 4 }
5 .cirque-stats { 5 .cirque-stats {
6 text-align: center; 6 text-align: center;
7 } 7 }
8 .cirque-stats .cirque-container { 8 .cirque-stats .cirque-container {
9 margin-top: 1.5em; 9 margin-top: 1.5em;
10 margin-bottom: 1.5em; 10 margin-bottom: 1.5em;
11 margin-right: 2em; 11 margin-right: 2em;
12 margin-left: 2em; 12 margin-left: 2em;
13 } 13 }
14 .subnavbar .mainnav > li:nth-child(3) > a{ 14 .subnavbar .mainnav > li:nth-child(3) > a{
15 color: #ff9900; 15 color: #ff9900;
16 } 16 }
17 .table { 17 .table {
18 border-collapse: separate; 18 border-collapse: separate;
19 padding: 0px; 19 padding: 0px;
20 20
21 } 21 }
22 22
23 23
24 24
25 25
26 </style> 26 </style>
27 <div class="main"> 27 <div class="main">
28 <div style="padding: 0 3%; margin-left: 15px;"> 28 <div style="padding: 0 3%; margin-left: 15px;">
29 <div class="row"> 29 <div class="row">
30 <div class="col-md-6"> 30 <div class="col-md-6">
31 <div class="customInputWrap"> 31 <div class="customInputWrap">
32 <div style="margin-left: 0px;"> 32 <div style="margin-left: 0px;">
33 <label>Date Range Filter</label> 33 <label>Date Range Filter</label>
34 <form name="myForm"> 34 <form name="myForm">
35 <input type="text" ng-model="drf.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> 35 <input type="text" ng-model="drf.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/>
36 <input type="text" ng-model="drf.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> 36 <input type="text" ng-model="drf.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;">
37 <button class="btn btn-primary" ng-disabled="myForm.$invalid" ng-click="submitDate()" style="float: left; display: none;">Apply</button> 37 <button class="btn btn-primary" ng-disabled="myForm.$invalid" ng-click="submitDate()" style="float: left; display: none;">Apply</button>
38 <button class="btn btn-primary" ng-click="submitDate()" style="float: left;">Apply</button> 38 <button class="btn btn-primary" ng-click="submitDate()" style="float: left;">Apply</button>
39 <div class="clearfix"></div> 39 <div class="clearfix"></div>
40 </form> 40 </form>
41 </div> 41 </div>
42 <div class="clearfix"></div> 42 <div class="clearfix"></div>
43 </div> 43 </div>
44 <div class="widget stacked"> 44 <div class="widget stacked">
45 <div class="widget-header"> 45 <div class="widget-header">
46 <i class="icon-bar-chart"></i> 46 <i class="icon-bar-chart"></i>
47 <h3>Monthly Fuel Sales</h3> 47 <h3>Monthly Fuel Sales</h3>
48 </div> 48 </div>
49 <!-- /widget-header --> 49 <!-- /widget-header -->
50 <div class="widget-content"> 50 <div class="widget-content">
51 <nvd3 options="optionsmfs" data="datamfs"></nvd3> 51 <nvd3 options="optionsmfs" data="datamfs"></nvd3>
52 <!-- /bar-chart --> 52 <!-- /bar-chart -->
53 </div> 53 </div>
54 <!-- /widget-content --> 54 <!-- /widget-content -->
55 </div> 55 </div>
56 <!-- /widget --> 56 <!-- /widget -->
57 </div> 57 </div>
58 <!-- /.span6 --> 58 <!-- /.span6 -->
59 <div class="col-md-6"> 59 <div class="col-md-6">
60 <div class="customInputWrap"> 60 <div class="customInputWrap">
61 <div style="margin-left: 0px;"> 61 <div style="margin-left: 0px;">
62 <label>Date Range Filter</label> 62 <label>Date Range Filter</label>
63 <form name="myForm1"> 63 <form name="myForm1">
64 <input type="text" ng-model="hfp.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> 64 <input type="text" ng-model="hfp.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/>
65 <input type="text" ng-model="hfp.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> 65 <input type="text" ng-model="hfp.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;">
66 <button class="btn btn-primary" ng-disabled="myForm1.$invalid" ng-click="submitDateHfp()" style="float: left; display: none;">Apply</button> 66 <button class="btn btn-primary" ng-disabled="myForm1.$invalid" ng-click="submitDateHfp()" style="float: left; display: none;">Apply</button>
67 <button class="btn btn-primary" ng-click="submitDateHfp()" style="float: left;">Apply</button> 67 <button class="btn btn-primary" ng-click="submitDateHfp()" style="float: left;">Apply</button>
68 <div class="clearfix"></div> 68 <div class="clearfix"></div>
69 </form> 69 </form>
70 </div> 70 </div>
71 <div class="clearfix"></div> 71 <div class="clearfix"></div>
72 </div> 72 </div>
73 <div class="widget stacked"> 73 <div class="widget stacked">
74 <div class="widget-header"> 74 <div class="widget-header">
75 <i class="icon-bar-chart"></i> 75 <i class="icon-bar-chart"></i>
76 <h3>Historic Fuel Pricing</h3> 76 <h3>Historic Fuel Pricing</h3>
77 </div> 77 </div>
78 <!-- /widget-header --> 78 <!-- /widget-header -->
79 <div class="widget-content"> 79 <div class="widget-content">
80 <nvd3 options="optionshfp" data="datahfp"></nvd3> 80 <nvd3 options="optionshfp" data="datahfp"></nvd3>
81 <!-- /pie-chart --> 81 <!-- /pie-chart -->
82 </div> 82 </div>
83 <!-- /widget-content --> 83 <!-- /widget-content -->
84 </div> 84 </div>
85 <!-- /widget --> 85 <!-- /widget -->
86 </div> 86 </div>
87 <!-- /span6 --> 87 <!-- /span6 -->
88 </div> 88 </div>
89 <div class="row"></div> 89 <div class="row"></div>
90 <div class="row"> 90 <div class="row">
91 <div class="col-md-6"> 91 <div class="col-md-6">
92 <div class="customInputWrap"> 92 <div class="customInputWrap">
93 <div style="margin-left: 0px;"> 93 <div style="margin-left: 0px;">
94 <label>Date Range Filter</label> 94 <label>Date Range Filter</label>
95 <form name="myForm2"> 95 <form name="myForm2">
96 <input type="text" ng-model="cs.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> 96 <input type="text" ng-model="cs.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/>
97 <input type="text" ng-model="cs.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> 97 <input type="text" ng-model="cs.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;">
98 <button class="btn btn-primary" ng-disabled="myForm2.$invalid" ng-click="submitDateCs()" style="float: left; display: none;">Apply</button> 98 <button class="btn btn-primary" ng-disabled="myForm2.$invalid" ng-click="submitDateCs()" style="float: left; display: none;">Apply</button>
99 <button class="btn btn-primary" ng-click="submitDateCs()" style="float: left;">Apply</button> 99 <button class="btn btn-primary" ng-click="submitDateCs()" style="float: left;">Apply</button>
100 <div class="clearfix"></div> 100 <div class="clearfix"></div>
101 </form> 101 </form>
102 </div> 102 </div>
103 <div class="clearfix"></div> 103 <div class="clearfix"></div>
104 </div> 104 </div>
105 <div class="widget stacked"> 105 <div class="widget stacked">
106 <div class="widget-header"> 106 <div class="widget-header">
107 <i class="icon-bar-chart"></i> 107 <i class="icon-bar-chart"></i>
108 <h3>Customer Sources</h3> 108 <h3>Customer Sources</h3>
109 </div> 109 </div>
110 <!-- /widget-header --> 110 <!-- /widget-header -->
111 <div class="widget-content"> 111 <div class="widget-content">
112 <div style="margin-left: -15px;"> 112 <div style="margin-left: -15px;">
113 <nvd3 options="optionscs" class="custom-graph" data="datacs"></nvd3> 113 <nvd3 options="optionscs" class="custom-graph" data="datacs"></nvd3>
114 </div> 114 </div>
115 <!-- /pie-chart --> 115 <!-- /pie-chart -->
116 </div> 116 </div>
117 <!-- /widget-content --> 117 <!-- /widget-content -->
118 </div> 118 </div>
119 <!-- /widget --> 119 <!-- /widget -->
120 </div> 120 </div>
121 <!-- /span6 --> 121 <!-- /span6 -->
122 <div class="col-md-6"> 122 <div class="col-md-6">
123 <div class="customInputWrap"> 123 <div class="customInputWrap">
124 <div style="margin-top: 75px"> 124 <div style="margin-top: 75px">
125 <!-- <label>Date Range Filter</label> 125 <!-- <label>Date Range Filter</label>
126 <form name="myForm3"> 126 <form name="myForm3">
127 <input type="text" ng-model="rpp.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/> 127 <input type="text" ng-model="rpp.fromDate" datepicker class="form-control" placeholder="From Date" required ng-required="true" style="width: 120px; float: left; margin-right: 15px;"/>
128 <input type="text" ng-model="rpp.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;"> 128 <input type="text" ng-model="rpp.toDate" datepicker class="form-control" placeholder="To Date" style="width: 120px; float: left; margin-right: 15px;">
129 <button class="btn btn-primary" ng-disabled="myForm3.$invalid" ng-click="submitDateRpp()" style="float: left; display: none;">Apply</button> 129 <button class="btn btn-primary" ng-disabled="myForm3.$invalid" ng-click="submitDateRpp()" style="float: left; display: none;">Apply</button>
130 <button class="btn btn-primary" ng-click="submitDateRpp()" style="float: left;">Apply</button> 130 <button class="btn btn-primary" ng-click="submitDateRpp()" style="float: left;">Apply</button>
131 <div class="clearfix"></div> 131 <div class="clearfix"></div>
132 </form> --> 132 </form> -->
133 </div> 133 </div>
134 <div class="clearfix"></div> 134 <div class="clearfix"></div>
135 </div> 135 </div>
136 <div class="widget stacked"> 136 <div class="widget stacked">
137 <div class="widget-header"> 137 <div class="widget-header">
138 <i class="icon-bar-chart"></i> 138 <i class="icon-bar-chart"></i>
139 <h3>Regional PAP Pricing</h3> 139 <h3>Regional PAP Pricing</h3>
140 </div> 140 </div>
141 <!-- /widget-header --> 141 <!-- /widget-header -->
142 <div class="widget-content"> 142 <div class="widget-content">
143 <div id="map" style="width: 100%; height: 325px;"></div> 143 <div id="map" style="width: 100%; height: 325px;"></div>
144 </div> 144 </div>
145 <!-- /widget-content --> 145 <!-- /widget-content -->
146 </div> 146 </div>
147 <!-- /widget --> 147 <!-- /widget -->
148 </div> 148 </div>
149 <!-- /.span6 --> 149 <!-- /.span6 -->
150 </div> 150 </div>
151 </div> 151 </div>
152 <!-- /container --> 152 <!-- /container -->
153 </div> 153 </div>
154 <!-- /main --> 154 <!-- /main -->
155 <div class="customConfirmPopBackdrop" id="popup1">
156 <div class="customModalInner" style="max-width: 400px;">
157 <div class="customModelBody" style="border-radius: 5px 5px 0 0;max-height: 200px;overflow: hidden;overflow-y: auto;"">
158 <table border="1">
159
160 <tr>
161 <th style="padding: 5px">Average PAP</th>
162 <th style="padding: 5px">Region</th>
163 </tr>
164 <tr ng-repeat="data in rppData">
165 <td data-title="'Average PAP'" style="padding: 5px">
166 <!-- <img src="img/info.png" style="width: 50px;"> -->
167 {{data.averagePAP | number :4 }}
168 </td>
169 <td data-title="'Region'" style="padding: 5px">
170 {{data.region}}
171 </td>
172 </tr>
173 </table>
174 </div>
175 <div class="customModelFooter text-right" style="border-top: 0px !important">
176 <!-- <button class="btn" style="padding: 4px 0; width: 80px;" ng-click="companyStatus()">Accept</button> -->
177 <button class="btn btn-primary" style="padding: 4px 0; width: 80px;" ng-click="cancelStatus()">Close</button>
178 </div>
179 </div>
180 </div>
181 <div class="myLoader" ng-show="showLoader">
182 <img src="../img/hourglass.gif" width="50px;">
183 </div>
184
155 185
156 186
app/partials/analytics/analytics.service.js
1 (function(){ 1 (function(){
2 'use strict'; 2 'use strict';
3 angular.module('acufuel') 3 angular.module('acufuel')
4 .service('analyticsService', ['$q', '$http', 'BASE_URL',analyticsService]); 4 .service('analyticsService', ['$q', '$http', 'BASE_URL',analyticsService]);
5 5
6 function analyticsService($q, $http, BASE_URL) { 6 function analyticsService($q, $http, BASE_URL) {
7 var temp = {}; 7 var temp = {};
8 8
9 9
10 this.getMFS = function(){ 10 this.getMFS = function(){
11 var deferred = $q.defer(); 11 var deferred = $q.defer();
12 $http({ 12 $http({
13 method : 'GET', 13 method : 'GET',
14 // url : BASE_URL.url +'/fuelOrder/export/mfs' 14 // url : BASE_URL.url +'/fuelOrder/export/mfs'
15 url : BASE_URL.url + '/fuelOrder/analytics' 15 url : BASE_URL.url + '/fuelOrder/analytics'
16 }) 16 })
17 .then(function (result){ 17 .then(function (result){
18 deferred.resolve(result.data); 18 deferred.resolve(result.data);
19 },function (result){ 19 },function (result){
20 console.log(result) 20 console.log(result)
21 deferred.resolve(result.data); 21 deferred.resolve(result.data);
22 }) 22 })
23 return deferred.promise; 23 return deferred.promise;
24 } 24 }
25 25
26 26
27 27
28 this.getCS = function(){ 28 this.getCS = function(){
29 var deferred = $q.defer(); 29 var deferred = $q.defer();
30 $http({ 30 $http({
31 method : 'GET', 31 method : 'GET',
32 url : BASE_URL.url +'/user/sources' 32 url : BASE_URL.url +'/user/sources'
33 }) 33 })
34 .then(function (result){ 34 .then(function (result){
35 deferred.resolve(result.data); 35 deferred.resolve(result.data);
36 },function (result){ 36 },function (result){
37 console.log(result) 37 console.log(result)
38 deferred.resolve(result.data); 38 deferred.resolve(result.data);
39 }) 39 })
40 return deferred.promise; 40 return deferred.promise;
41 } 41 }
42 42
43 this.getRPP = function(code){
44 var deferred = $q.defer();
45 $http({
46 method : 'GET',
47 url : BASE_URL.url +'/fuelerlinx/getAircrafts/'+code
48 })
49 .then(function (result){
50 deferred.resolve(result.data);
51 },function (result){
52 console.log(result)
53 deferred.resolve(result.data);
54 })
55 return deferred.promise;
56 }
57
58
43 /*---date filter for Monthly fuel sales chart - dates are sending to the api */ 59 /*---date filter for Monthly fuel sales chart - dates are sending to the api */
44 this.getDRFChart = function(fd,td){ 60 this.getDRFChart = function(fd,td){
45 var deferred = $q.defer(); 61 var deferred = $q.defer();
46 $http({ 62 $http({
47 method : 'GET', 63 method : 'GET',
48 url : BASE_URL.url + '/fuelOrder/filterchart?fromDate='+fd+'&toDate='+td+'' 64 url : BASE_URL.url + '/fuelOrder/filterchart?fromDate='+fd+'&toDate='+td+''
49 }) 65 })
50 .then(function (result){ 66 .then(function (result){
51 deferred.resolve(result.data); 67 deferred.resolve(result.data);
52 },function (result){ 68 },function (result){
53 console.log(result) 69 console.log(result)
54 deferred.resolve(result.data); 70 deferred.resolve(result.data);
55 }) 71 })
56 return deferred.promise; 72 return deferred.promise;
57 } 73 }
58 74
59 /*---date filter for Historic Fuel price --- DRF--Date Range Filter */ 75 /*---date filter for Historic Fuel price --- DRF--Date Range Filter */
60 this.getDRFHfpChart = function(fd,td){ 76 this.getDRFHfpChart = function(fd,td){
61 var deferred = $q.defer(); 77 var deferred = $q.defer();
62 $http({ 78 $http({
63 method : 'GET', 79 method : 'GET',
64 url : BASE_URL.url + '/fuelOrder/hfp/filterchart?fromDate='+fd+'&toDate='+td+'' 80 url : BASE_URL.url + '/fuelOrder/hfp/filterchart?fromDate='+fd+'&toDate='+td+''
65 }) 81 })
66 .then(function (result){ 82 .then(function (result){
67 deferred.resolve(result.data); 83 deferred.resolve(result.data);
68 },function (result){ 84 },function (result){
69 console.log(result) 85 console.log(result)
70 deferred.resolve(result.data); 86 deferred.resolve(result.data);
71 }) 87 })
72 return deferred.promise; 88 return deferred.promise;
73 } 89 }
74 90
75 /*---date filter for Customer Sources --- DRF--Date Range Filter */ 91 /*---date filter for Customer Sources --- DRF--Date Range Filter */
76 this.getDRFCSChart = function(fd,td){ 92 this.getDRFCSChart = function(fd,td){
77 var deferred = $q.defer(); 93 var deferred = $q.defer();
78 $http({ 94 $http({
79 method : 'GET', 95 method : 'GET',
80 url : BASE_URL.url + '/user/cs/filterchart?fromDate='+fd+'&toDate='+td+'' 96 url : BASE_URL.url + '/user/cs/filterchart?fromDate='+fd+'&toDate='+td+''
81 }) 97 })
82 .then(function (result){ 98 .then(function (result){
83 deferred.resolve(result.data); 99 deferred.resolve(result.data);
84 },function (result){ 100 },function (result){
85 console.log(result) 101 console.log(result)
86 deferred.resolve(result.data); 102 deferred.resolve(result.data);
87 }) 103 })
88 return deferred.promise; 104 return deferred.promise;
89 } 105 }
90 106
91 } 107 }
92 108
93 })(); 109 })();