| Module | Gruff::Base::StackedMixin |
| In: |
lib/gruff/stacked_mixin.rb
|
| DATA_VALUES_INDEX | = | Gruff::Base::DATA_VALUES_INDEX |
Used by StackedBar and child classes.
tsal: moved from Base 03 FEB 2007 |
# File lib/gruff/stacked_mixin.rb, line 7
7: def get_maximum_by_stack
8: # Get sum of each stack
9: max_hash = {}
10: @data.each do |data_set|
11: data_set[DATA_VALUES_INDEX].each_with_index do |data_point, i|
12: max_hash[i] = 0.0 unless max_hash[i]
13: max_hash[i] += data_point.to_f
14: end
15: end
16:
17: # @maximum_value = 0
18: max_hash.keys.each do |key|
19: @maximum_value = max_hash[key] if max_hash[key] > @maximum_value
20: end
21: @minimum_value = 0
22: end