Class: WSaleOfferDecorator
- Inherits:
-
GraphDecoration
- Object
- GraphDecoration
- WSaleOfferDecorator
- Defined in:
- lib/graph_decorator.rb
Instance Method Summary collapse
-
#initialize(real_graph) ⇒ WSaleOfferDecorator
constructor
A new instance of WSaleOfferDecorator.
Methods inherited from GraphDecoration
#doubleChart, #multipleChart, #singleChart
Constructor Details
#initialize(real_graph) ⇒ WSaleOfferDecorator
Returns a new instance of WSaleOfferDecorator.
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/graph_decorator.rb', line 97 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 = Wsale.order('id desc').select("offeredSale").group_by{|o| o.offeredSale}.keys.take(7) @y_data_2 = Wsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7) @x_name = Wsale.order('id desc').select("week").group_by{|o| o.week}.keys.take(7) @y_data_3 = Wsale.order('id desc').select("nonOfferedSale").group_by{|o| o.nonOfferedSale}.keys.take(7) end |