lib/gruff/helper/stacked_mixin.rb
# Used by StackedBar and child classes.
#
# tsal: moved from Base 03 FEB 2007
Used by StackedBar and child classes.
tsal: moved from Base 03 FEB 2007
Used by StackedBar and child classes . tsal : moved from Base 03 FEB 2007
def calculate_maximum_by_stack
    max_hash = Hash.new { |h, k| h[k] = 0.0 }
    store.data.each do |data_set|
      data_set.points.each_with_index do |data_point, i|
        max_hash[i] += data_point.to_f
      end
    end
    max_hash.each_key do |key|
      self.maximum_value = max_hash[key] if max_hash[key] > maximum_value
    end
    self.minimum_value = 0
  end
def calculate_maximum_by_stack max_hash = Hash . new { | h , k | h [ k ] = 0.0 } store . data . each do | data_set | data_set . points . each_with_index do | data_point , i | max_hash [ i ] += data_point . to_f end end max_hash . each_key do | key | self . maximum_value = max_hash [ key ] if max_hash [ key ] > maximum_value end self . minimum_value = 0 end
Used by StackedBar and child classes.
Used by StackedBar and child classes .
# Get sum of each stack