Sha256: e36c22cc7cffe83decb5d901c6cbb8d7b7530e40e058b576ff9866e0b7977974

Contents?: true

Size: 616 Bytes

Versions: 32

Compression:

Stored size: 616 Bytes

Contents

module Gruff::Base::StackedMixin
  # Used by StackedBar and child classes.
  #
  # tsal: moved from Base 03 FEB 2007
  DATA_VALUES_INDEX = Gruff::Base::DATA_VALUES_INDEX
  def get_maximum_by_stack
    # Get sum of each stack
    max_hash = {}
    @data.each do |data_set|
      data_set[DATA_VALUES_INDEX].each_with_index do |data_point, i|
        max_hash[i] = 0.0 unless max_hash[i]
        max_hash[i] += data_point.to_f
      end
    end
  
    # @maximum_value = 0
    max_hash.keys.each do |key|
      @maximum_value = max_hash[key] if max_hash[key] > @maximum_value
    end
    @minimum_value = 0
  end
end

Version data entries

32 entries across 32 versions & 11 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/gruff-0.7.0/lib/gruff/stacked_mixin.rb
gruff-0.7.0-java lib/gruff/stacked_mixin.rb
gruff-0.7.0 lib/gruff/stacked_mixin.rb
gruff-0.6.0-java lib/gruff/stacked_mixin.rb
gruff-0.6.0 lib/gruff/stacked_mixin.rb
jslade-gruff-0.3.5 lib/gruff/stacked_mixin.rb
schapht-gruff-0.3.5 lib/gruff/stacked_mixin.rb
topfunky-gruff-0.3.2 lib/gruff/stacked_mixin.rb
topfunky-gruff-0.3.3 lib/gruff/stacked_mixin.rb
topfunky-gruff-0.3.5 lib/gruff/stacked_mixin.rb
umang-gruff-0.3.6 lib/gruff/stacked_mixin.rb
woodhull-gruff-0.3.5 lib/gruff/stacked_mixin.rb
gruff-0.5.1-java lib/gruff/stacked_mixin.rb
gruff-0.5.1 lib/gruff/stacked_mixin.rb
gruff-0.5.0-java lib/gruff/stacked_mixin.rb
gruff-0.5.0 lib/gruff/stacked_mixin.rb
gruff-0.4.0 lib/gruff/stacked_mixin.rb
gruff-0.4.0-java lib/gruff/stacked_mixin.rb
gruff-0.3.7 lib/gruff/stacked_mixin.rb
fhs-gruff-0.3.6.2 lib/gruff/stacked_mixin.rb