Class: DSaleOfferDecorator
- Inherits:
-
GraphDecoration
- Object
- GraphDecoration
- DSaleOfferDecorator
- Defined in:
- lib/graph_decorator.rb
Instance Method Summary collapse
-
#initialize(real_graph) ⇒ DSaleOfferDecorator
constructor
A new instance of DSaleOfferDecorator.
Methods inherited from GraphDecoration
#doubleChart, #multipleChart, #singleChart
Constructor Details
#initialize(real_graph) ⇒ DSaleOfferDecorator
Returns a new instance of DSaleOfferDecorator.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/graph_decorator.rb', line 58 def initialize(real_graph) super(real_graph) @y_name_1 = "Offered Sale" @y_name_2 = "Non Offered Sale" @y_name_3 = "Non Offered Sale" @y_data_1 = Dsale.order('id desc').select("offeredSale").group_by{|o| o.offeredSale}.keys.take(7) @y_data_2 = Dsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7) @x_name = Dsale.order('id desc').select("day").group_by{|o| o.day}.keys.take(7) @y_data_3 = Dsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7) end |