Class: ReturningCustomers
- Inherits:
-
GraphDecoration
- Object
- GraphDecoration
- ReturningCustomers
- Defined in:
- lib/graph_decorator.rb
Instance Method Summary collapse
-
#initialize(real_graph) ⇒ ReturningCustomers
constructor
A new instance of ReturningCustomers.
Methods inherited from GraphDecoration
#doubleChart, #multipleChart, #singleChart
Constructor Details
#initialize(real_graph) ⇒ ReturningCustomers
Returns a new instance of ReturningCustomers.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/graph_decorator.rb', line 190 def initialize(real_graph) super(real_graph) @y_name_1 = "New Cusomtomers" @y_name_2 = "Frequent Customers" @y_name_3 = "Total no of sign in count in this website" @sum_new = 0 @sum_old = 0 @new_customer_count = Member.select("sign_in_count").group_by{|o| o.sign_in_count}.keys @new_customer_count.each do |cust| if cust > 3 @sum_old+=1 else @sum_new+=1 end end @y_data_1 = @sum_new @y_data_2 = @sum_old @x_name = ['new customer', 'old customer'] @y_data_3 = Member.sum("sign_in_count") end |