lib/gruff/base.rb
# Make copy of data with values scaled between 0-100
Make copy of data with values scaled between 0-100
Make copy of data with values scaled between 0 - 100
def normalize(force=false)
      if @norm_data.nil? || force
        @norm_data = []
        return unless @has_data
        calculate_spread
        @data.each do |data_row|
          norm_data_points = []
          data_row[DATA_VALUES_INDEX].each do |data_point|
            if data_point.nil?
              norm_data_points << nil
            else
              norm_data_points << ((data_point.to_f - @minimum_value.to_f ) / @spread)
            end
          end
          @norm_data << [data_row[DATA_LABEL_INDEX], norm_data_points, data_row[DATA_COLOR_INDEX]]
        end
      end
    end
def normalize ( force = false ) if @norm_data . nil? || force @norm_data = [ ] return unless @has_data calculate_spread @data . each do | data_row | norm_data_points = [ ] data_row [ DATA_VALUES_INDEX ] . each do | data_point | if data_point . nil? norm_data_points << nil else norm_data_points << ( ( data_point . to_f - @minimum_value . to_f ) / @spread ) end end @norm_data << [ data_row [ DATA_LABEL_INDEX ] , norm_data_points , data_row [ DATA_COLOR_INDEX ] ] end end end
Make copy of data with values scaled between 0-100
Make copy of data with values scaled between 0 - 100
force
<not_specific>