Blame view

app/partials/analytics/analytics.controller.js 6.77 KB
feacde5ff   Rishav   setup acuefuel in...
1
2
3
4
5
6
  'use strict';
  
   //Load controller
    angular.module('acufuel')
  
  	.controller('analyticsController', ['$scope',function($scope) {
05bfa28a2   Mr. Hot Foods   remove save butto...
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
      $(document).ready(function(){
        $(function () {
     
            $.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=us-population-density.json&callback=?', function (data) {
     
                // Make codes uppercase to match the map data
                $.each(data, function () {
                    this.code = this.code.toUpperCase();
                });
     
                // Instanciate the map
                Highcharts.mapChart('container', {
     
                    chart: {
                        borderWidth: 1
                    },
     
                    title: {
                        text: 'US population density (/km²)'
                    },
     
                    legend: {
                        layout: 'horizontal',
                        borderWidth: 0,
                        backgroundColor: 'rgba(255,255,255,0.85)',
                        floating: true,
                        verticalAlign: 'top',
                        y: 25
                    },
     
                    mapNavigation: {
                        enabled: true
                    },
     
                    colorAxis: {
                        min: 1,
                        type: 'logarithmic',
                        minColor: '#EEEEFF',
                        maxColor: '#000022',
                        stops: [
                            [0, '#EFEFFF'],
                            [0.67, '#4444FF'],
                            [1, '#000022']
                        ]
                    },
     
                    series: [{
                        animation: {
                            duration: 1000
                        },
                        data: data,
                        mapData: Highcharts.maps['countries/us/us-all'],
                        joinBy: ['postal-code', 'code'],
                        dataLabels: {
                            enabled: true,
                            color: '#FFFFFF',
                            format: '{point.code}'
                        },
                        name: 'Population density',
                        tooltip: {
                            pointFormat: '{point.code}: {point.value}/km²'
                        }
                    }]
                });
            });
        });
     })
  
        $scope.optionsmfs = {
                              chart: {
                                  type: 'discreteBarChart',
                                  height: 450,
                                  margin : {
                                      top: 20,
                                      right: 20,
                                      bottom: 60,
                                      left: 55,
                                  },
                                  color: ["#FF7F0E"],
                                  x: function(d){ return d.label; },
                                  y: function(d){ return d.value; },
                                  showValues: false,
                                  valueFormat: function(d){
                                      return d3.format(',.4f')(d);
                                  },
                                  transitionDuration: 500,
                                  xAxis: {
                                      axisLabel: 'X Axis'
                                  },
                                  yAxis: {
                                      axisLabel: 'Y Axis',
                                      axisLabelDistance: 30
                                  }
                              }
                          };
  
             $scope.datamfs = [{
                              key: "Cumulative Return",
                              values: [
                                  { "label" : "A" , "value" : 229.765957771107 },
                                  { "label" : "B" , "value" : 0 },
                                  { "label" : "C" , "value" : 32.807804682612 },
                                  { "label" : "D" , "value" : 196.45946739256 },
                                  { "label" : "E" , "value" : 0.19434030906893 },
                                  { "label" : "F" , "value" : 98.079782601442 },
                                  { "label" : "G" , "value" : 13.925743130903 },
                                  { "label" : "H" , "value" : 5.1387322875705 },
                                  { "label" : "I" , "value" : 4.1387322875705 },
                                  { "label" : "J" , "value" : 23.1387322875705 },
                                  { "label" : "K" , "value" : 233.1387322875705 },
                                  { "label" : "L" , "value" : 22.1387322875705 },
                                  ]
                              }]
  
             $scope.optionspc = {
                                  chart: {
                                      type: 'pieChart',
                                      height: 500,
                                      minColor: ["#FEDFC3"],
                                      maxColor: ["#FF7F0E"],
                                      x: function(d){return d.key;},
                                      y: function(d){return d.y;},
                                      showLabels: false,
                                      segmentShowStroke : false,
                                      animationSteps : 20,
                                      animationEasing : "linear",
                                      animateScale : true,
                                      duration: 500,
                                      labelThreshold: 0.01,
                                      labelSunbeamLayout: true,
                                      legend: {
                                          margin: {
                                              top: 5,
                                              right: 35,
                                              bottom: 5,
                                              left: 0
                                          }
                                      }
                                  }
                              };
  
              $scope.datapc = [
                                  {
                                      key: "A",
                                      y: 3
                                  },
                                  {
                                      key: "B",
                                      y: 2
                                  },
                                  {
                                      key: "C",
                                      y: 3
                                  },
                                  {
                                      key: "D",
                                      y: 1
                                  },
                                  {
                                      key: "E",
                                      y: 5
                                  }
                              ];
feacde5ff   Rishav   setup acuefuel in...
170
171
  
      }]);