graph_decorator 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/graph_decorator.rb +168 -42
- data/lib/graph_decorator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e10932bbfd58ee6e48f15fd32db858a376c898b6
|
4
|
+
data.tar.gz: 3eb8b03cafaebc4f2c2172ff378f5c5697748048
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ada6da57f72c0f085e8225b90aeec20bc929a1185dadf6bb8ab875c4d04b2324df2a15dc6eabc4ebe75a2097d0b7a41513026fbedcbed7da254950c30e74484
|
7
|
+
data.tar.gz: e9bfa8f22a7fae0fa64df524eb371947c6bee813c2103fd04c61dfa65272f542c43160e3e9d541e77a2092a34a170a60c5378afb9d63a15b7a05216ef215fb86
|
data/lib/graph_decorator.rb
CHANGED
@@ -57,6 +57,17 @@ class DSalesDecorator < GraphDecoration
|
|
57
57
|
@y_name_1 = "Total Sale"
|
58
58
|
@y_name_2 = "Profit"
|
59
59
|
@y_name_3 = "Non Offered Sale"
|
60
|
+
@y_data_1 = []
|
61
|
+
@y_data_2 = []
|
62
|
+
@y_data_3 = []
|
63
|
+
@x_name = []
|
64
|
+
@y_data = Dsale.all
|
65
|
+
@y_data.each do |pro|
|
66
|
+
@y_data_1 << pro.totalSale
|
67
|
+
@y_data_2 << pro.profit
|
68
|
+
@y_data_3 << pro.nonOfferedSale
|
69
|
+
@x_name << pro.day
|
70
|
+
end
|
60
71
|
@y_data_1 = Dsale.order('id desc').select("totalSale").group_by{|o| o.totalSale}.keys.take(7)
|
61
72
|
@y_data_2 = Dsale.order('id desc').select("profit").group_by{|o| o.profit}.keys.take(7)
|
62
73
|
@x_name = Dsale.order('id desc').select("day").group_by{|o| o.day}.keys.take(7)
|
@@ -72,10 +83,21 @@ class DSaleOfferDecorator < GraphDecoration
|
|
72
83
|
@y_name_1 = "Offered Sale"
|
73
84
|
@y_name_2 = "Non Offered Sale"
|
74
85
|
@y_name_3 = "Non Offered Sale"
|
75
|
-
@y_data_1 =
|
76
|
-
@y_data_2 =
|
77
|
-
@
|
78
|
-
@
|
86
|
+
@y_data_1 = []
|
87
|
+
@y_data_2 = []
|
88
|
+
@y_data_3 = []
|
89
|
+
@x_name = []
|
90
|
+
@y_data = Dsale.all
|
91
|
+
@y_data.each do |pro|
|
92
|
+
@y_data_1 << pro.offeredSale
|
93
|
+
@y_data_2 << pro.nonOfferedSale
|
94
|
+
@y_data_3 << pro.nonOfferedSale
|
95
|
+
@x_name << pro.day
|
96
|
+
end
|
97
|
+
#@y_data_1 = Dsale.order('id desc').select("offeredSale").group_by{|o| o.offeredSale}.keys.take(7)
|
98
|
+
#@y_data_2 = Dsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
99
|
+
#@x_name = Dsale.order('id desc').select("day").group_by{|o| o.day}.keys.take(7)
|
100
|
+
#@y_data_3 = Dsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
79
101
|
end
|
80
102
|
end
|
81
103
|
|
@@ -87,10 +109,21 @@ class DSaleTypeDecorator < GraphDecoration
|
|
87
109
|
@y_name_1 = "Non Veg Sale"
|
88
110
|
@y_name_2 = "Veg Sale"
|
89
111
|
@y_name_3 = "Non Offered Sale"
|
90
|
-
@y_data_1 =
|
91
|
-
@y_data_2 =
|
92
|
-
@
|
93
|
-
@
|
112
|
+
@y_data_1 = []
|
113
|
+
@y_data_2 = []
|
114
|
+
@y_data_3 = []
|
115
|
+
@x_name = []
|
116
|
+
@y_data = Dsale.all
|
117
|
+
@y_data.each do |pro|
|
118
|
+
@y_data_1 << pro.nonVegSale
|
119
|
+
@y_data_2 << pro.vegSale
|
120
|
+
@y_data_3 << pro.nonOfferedSale
|
121
|
+
@x_name << pro.day
|
122
|
+
end
|
123
|
+
#@y_data_1 = Dsale.order('id desc').select("nonVegSale").group_by{|o| o.nonVegSale}.keys.take(7)
|
124
|
+
#@y_data_2 = Dsale.order('id desc').select("vegSale").group_by{|o| o.vegSale}.keys.take(7)
|
125
|
+
#@x_name = Dsale.order('id desc').select("day").group_by{|o| o.day}.keys.take(7)
|
126
|
+
#@y_data_3 = Dsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
94
127
|
end
|
95
128
|
end
|
96
129
|
|
@@ -102,10 +135,21 @@ class WSalesDecorator < GraphDecoration
|
|
102
135
|
@y_name_1 = "Total Sale"
|
103
136
|
@y_name_2 = "Profit"
|
104
137
|
@y_name_3 = "Non Offered Sale"
|
105
|
-
@y_data_1 =
|
106
|
-
@y_data_2 =
|
107
|
-
@
|
108
|
-
@
|
138
|
+
@y_data_1 = []
|
139
|
+
@y_data_2 = []
|
140
|
+
@y_data_3 = []
|
141
|
+
@x_name = []
|
142
|
+
@y_data = Wsale.all
|
143
|
+
@y_data.each do |pro|
|
144
|
+
@y_data_1 << pro.totalSale
|
145
|
+
@y_data_2 << pro.profit
|
146
|
+
@y_data_3 << pro.nonOfferedSale
|
147
|
+
@x_name << pro.week
|
148
|
+
end
|
149
|
+
#@y_data_1 = Wsale.order('id desc').select("totalSale").group_by{|o| o.totalSale}.keys.take(7)
|
150
|
+
#@y_data_2 = Wsale.order('id desc').select("profit").group_by{|o| o.profit}.keys.take(7)
|
151
|
+
#@x_name = Wsale.order('id desc').select("week").group_by{|o| o.week}.keys.take(7)
|
152
|
+
#@y_data_3 = Wsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
109
153
|
end
|
110
154
|
end
|
111
155
|
|
@@ -117,10 +161,21 @@ class WSaleOfferDecorator < GraphDecoration
|
|
117
161
|
@y_name_1 = "Offered Sale"
|
118
162
|
@y_name_2 = "Non Offered Sale"
|
119
163
|
@y_name_3 = "Non Offered Sale"
|
120
|
-
@y_data_1 =
|
121
|
-
@y_data_2 =
|
122
|
-
@
|
123
|
-
@
|
164
|
+
@y_data_1 = []
|
165
|
+
@y_data_2 = []
|
166
|
+
@y_data_3 = []
|
167
|
+
@x_name = []
|
168
|
+
@y_data = Wsale.all
|
169
|
+
@y_data.each do |pro|
|
170
|
+
@y_data_1 << pro.offeredSale
|
171
|
+
@y_data_2 << pro.nonOfferedSale
|
172
|
+
@y_data_3 << pro.nonOfferedSale
|
173
|
+
@x_name << pro.week
|
174
|
+
end
|
175
|
+
#@y_data_1 = Wsale.order('id desc').select("offeredSale").group_by{|o| o.offeredSale}.keys.take(7)
|
176
|
+
#@y_data_2 = Wsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
177
|
+
#@x_name = Wsale.order('id desc').select("week").group_by{|o| o.week}.keys.take(7)
|
178
|
+
#@y_data_3 = Wsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
124
179
|
end
|
125
180
|
end
|
126
181
|
|
@@ -132,10 +187,21 @@ class WSaleTypeDecorator < GraphDecoration
|
|
132
187
|
@y_name_1 = "Non Veg Sale"
|
133
188
|
@y_name_2 = "Veg Sale"
|
134
189
|
@y_name_3 = "Non Offered Sale"
|
135
|
-
@y_data_1 =
|
136
|
-
@y_data_2 =
|
137
|
-
@
|
138
|
-
@
|
190
|
+
@y_data_1 = []
|
191
|
+
@y_data_2 = []
|
192
|
+
@y_data_3 = []
|
193
|
+
@x_name = []
|
194
|
+
@y_data = Wsale.all
|
195
|
+
@y_data.each do |pro|
|
196
|
+
@y_data_1 << pro.nonVegSale
|
197
|
+
@y_data_2 << pro.vegSale
|
198
|
+
@y_data_3 << pro.nonOfferedSale
|
199
|
+
@x_name << pro.week
|
200
|
+
end
|
201
|
+
#@y_data_1 = Wsale.order('id desc').select("nonVegSale").group_by{|o| o.nonVegSale}.keys.take(7)
|
202
|
+
#@y_data_2 = Wsale.order('id desc').select("vegSale").group_by{|o| o.vegSale}.keys.take(7)
|
203
|
+
#@x_name = Wsale.order('id desc').select("week").group_by{|o| o.week}.keys.take(7)
|
204
|
+
#@y_data_3 = Wsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
139
205
|
end
|
140
206
|
end
|
141
207
|
|
@@ -148,10 +214,21 @@ class MSalesDecorator < GraphDecoration
|
|
148
214
|
@y_name_1 = "Total Sale"
|
149
215
|
@y_name_2 = "Profit"
|
150
216
|
@y_name_3 = "Non Offered Sale"
|
151
|
-
@y_data_1 =
|
152
|
-
@y_data_2 =
|
153
|
-
@
|
154
|
-
@
|
217
|
+
@y_data_1 = []
|
218
|
+
@y_data_2 = []
|
219
|
+
@y_data_3 = []
|
220
|
+
@x_name = []
|
221
|
+
@y_data = Msale.all
|
222
|
+
@y_data.each do |pro|
|
223
|
+
@y_data_1 << pro.totalSale
|
224
|
+
@y_data_2 << pro.profit
|
225
|
+
@y_data_3 << pro.nonOfferedSale
|
226
|
+
@x_name << pro.month
|
227
|
+
end
|
228
|
+
#@y_data_1 = Msale.order('id desc').select("totalSale").group_by{|o| o.totalSale}.keys.take(7)
|
229
|
+
#@y_data_2 = Msale.order('id desc').select("profit").group_by{|o| o.profit}.keys.take(7)
|
230
|
+
#@x_name = Msale.order('id desc').select("month").group_by{|o| o.month}.keys.take(7)
|
231
|
+
#@y_data_3 = Msale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
155
232
|
end
|
156
233
|
end
|
157
234
|
|
@@ -163,10 +240,21 @@ class MSaleOfferDecorator < GraphDecoration
|
|
163
240
|
@y_name_1 = "Offered Sale"
|
164
241
|
@y_name_2 = "Non Offered Sale"
|
165
242
|
@y_name_3 = "Non Offered Sale"
|
166
|
-
@y_data_1 =
|
167
|
-
@y_data_2 =
|
168
|
-
@
|
169
|
-
@
|
243
|
+
@y_data_1 = []
|
244
|
+
@y_data_2 = []
|
245
|
+
@y_data_3 = []
|
246
|
+
@x_name = []
|
247
|
+
@y_data = Msale.all
|
248
|
+
@y_data.each do |pro|
|
249
|
+
@y_data_1 << pro.offeredSale
|
250
|
+
@y_data_2 << pro.nonOfferedSale
|
251
|
+
@y_data_3 << pro.nonOfferedSale
|
252
|
+
@x_name << pro.month
|
253
|
+
end
|
254
|
+
#@y_data_1 = Msale.order('id desc').select("offeredSale").group_by{|o| o.offeredSale}.keys.take(7)
|
255
|
+
#@y_data_2 = Msale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
256
|
+
#@x_name = Msale.order('id desc').select("month").group_by{|o| o.month}.keys.take(7)
|
257
|
+
#@y_data_3 = Msale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
170
258
|
end
|
171
259
|
end
|
172
260
|
|
@@ -178,10 +266,21 @@ class MSaleTypeDecorator < GraphDecoration
|
|
178
266
|
@y_name_1 = "Non Veg Sale"
|
179
267
|
@y_name_2 = "Veg Sale"
|
180
268
|
@y_name_3 = "Non Offered Sale"
|
181
|
-
@y_data_1 =
|
182
|
-
@y_data_2 =
|
183
|
-
@
|
184
|
-
@
|
269
|
+
@y_data_1 = []
|
270
|
+
@y_data_2 = []
|
271
|
+
@y_data_3 = []
|
272
|
+
@x_name = []
|
273
|
+
@y_data = Msale.all
|
274
|
+
@y_data.each do |pro|
|
275
|
+
@y_data_1 << pro.nonVegSale
|
276
|
+
@y_data_2 << pro.vegSale
|
277
|
+
@y_data_3 << pro.nonOfferedSale
|
278
|
+
@x_name << pro.month
|
279
|
+
end
|
280
|
+
#@y_data_1 = Msale.order('id desc').select("nonVegSale").group_by{|o| o.nonVegSale}.keys.take(7)
|
281
|
+
#@y_data_2 = Msale.order('id desc').select("vegSale").group_by{|o| o.vegSale}.keys.take(7)
|
282
|
+
#@x_name = Msale.order('id desc').select("month").group_by{|o| o.month}.keys.take(7)
|
283
|
+
#@y_data_3 = Msale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7)
|
185
284
|
end
|
186
285
|
end
|
187
286
|
|
@@ -193,10 +292,21 @@ class ProductDecorator < GraphDecoration
|
|
193
292
|
super(real_graph)
|
194
293
|
@y_name_1 = "Actual Price"
|
195
294
|
@y_name_2 = "Offer Price"
|
196
|
-
@y_data_1 =
|
197
|
-
@y_data_2 =
|
198
|
-
@
|
199
|
-
@
|
295
|
+
@y_data_1 = []
|
296
|
+
@y_data_2 = []
|
297
|
+
@y_data_3 = []
|
298
|
+
@x_name = []
|
299
|
+
@y_data = Product.all
|
300
|
+
@y_data.each do |pro|
|
301
|
+
@y_data_1 << pro.price
|
302
|
+
@y_data_2 << pro.offerPrice
|
303
|
+
@y_data_3 << pro.quantityAvailable
|
304
|
+
@x_name << pro.name
|
305
|
+
end
|
306
|
+
#@y_data_1 = Product.select("price").group_by{|o| o.price}.keys
|
307
|
+
#@y_data_2 = Product.select("offerPrice").group_by{|o| o.offerPrice}.keys
|
308
|
+
#@x_name = Product.select("name").group_by{|o| o.name}.keys
|
309
|
+
#@y_data_3 = Product.select("quantityAvailable").group_by{|o| o.quantityAvailable}.keys
|
200
310
|
@y_name_3 = "Quantity Available"
|
201
311
|
end
|
202
312
|
end
|
@@ -208,10 +318,21 @@ class ProductByHitDecorator < GraphDecoration
|
|
208
318
|
super(real_graph)
|
209
319
|
@y_name_1 = "No. of sales"
|
210
320
|
@y_name_2 = "Hit"
|
211
|
-
@y_data_1 =
|
212
|
-
@y_data_2 =
|
213
|
-
@
|
214
|
-
@
|
321
|
+
@y_data_1 = []
|
322
|
+
@y_data_2 = []
|
323
|
+
@y_data_3 = []
|
324
|
+
@x_name = []
|
325
|
+
@y_data = Product.all
|
326
|
+
@y_data.each do |pro|
|
327
|
+
@y_data_1 << pro.count
|
328
|
+
@y_data_2 << pro.hit
|
329
|
+
@y_data_3 << pro.quantityAvailable
|
330
|
+
@x_name << pro.name
|
331
|
+
end
|
332
|
+
#@y_data_1 = Product.select("count").group_by{|o| o.count}.keys
|
333
|
+
#@y_data_2 = Product.select("hit").group_by{|o| o.hit}.keys
|
334
|
+
#@x_name = Product.select("name").group_by{|o| o.name}.keys
|
335
|
+
#@y_data_3 = Product.select("quantityAvailable").group_by{|o| o.quantityAvailable}.keys
|
215
336
|
@y_name_3 = "Quantity Available"
|
216
337
|
end
|
217
338
|
end
|
@@ -226,7 +347,12 @@ class ReturningCustomers < GraphDecoration
|
|
226
347
|
@y_name_3 = "Total no of sign in count in this website"
|
227
348
|
@cust_new = 0
|
228
349
|
@customer_return = 0
|
229
|
-
|
350
|
+
#@new_customer_count = Member.select("sign_in_count").group_by{|o| o.sign_in_count}.keys
|
351
|
+
@new_customer_count = []
|
352
|
+
@y_cust_data = Member.all
|
353
|
+
@y_cust_data.each do |cp|
|
354
|
+
@new_customer_count << cp.sign_in_count
|
355
|
+
end
|
230
356
|
@new_customer_count.each do |cust|
|
231
357
|
if cust > 3
|
232
358
|
@customer_return += 1
|
@@ -236,7 +362,7 @@ class ReturningCustomers < GraphDecoration
|
|
236
362
|
end
|
237
363
|
@y_data_1 = @cust_new
|
238
364
|
@y_data_2 = @customer_return
|
239
|
-
@x_name = ['
|
365
|
+
@x_name = ['Customer Ratio']
|
240
366
|
@y_data_3 = Member.sum("sign_in_count")
|
241
367
|
|
242
368
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graph_decorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kishore Kumar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|