Class: ProductByHitDecorator

Inherits:
GraphDecoration show all
Defined in:
lib/graph_decorator.rb

Instance Method Summary collapse

Methods inherited from GraphDecoration

#doubleChart, #multipleChart, #singleChart

Constructor Details

#initialize(real_graph) ⇒ ProductByHitDecorator

Returns a new instance of ProductByHitDecorator.



177
178
179
180
181
182
183
184
185
186
# File 'lib/graph_decorator.rb', line 177

def initialize(real_graph)
  super(real_graph)
  @y_name_1 = "No. of sales"
       @y_name_2 = "Hit"
       @y_data_1 = Product.select("count").group_by{|o| o.count}.keys
       @y_data_2 = Product.select("hit").group_by{|o| o.hit}.keys
       @x_name = Product.select("name").group_by{|o| o.name}.keys
       @y_data_3 = Product.select("quantityAvailable").group_by{|o| o.quantityAvailable}.keys
       @y_name_3 = "Quantity Available"
end