lib/gruff/ldata_mixin.rb
# Same as data, but you can defined groups of lines.
# The lines points will be x centered on the bar corresponding to
# the group.
Same as data, but you can defined groups of lines.
The lines points will be x centered on the bar corresponding to
the group.
Same as data but you can defined groups of lines . The lines points will be x centered on the bar corresponding to the group .
def normalize_ldata
    return unless @has_ldata
    @ldata.each do |data_row|
      norm_data_points = []
      data_row[Gruff::Base::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_ldata << [
	data_row[Gruff::Base::DATA_LABEL_INDEX], 
	norm_data_points,   
	data_row[Gruff::Base::DATA_COLOR_INDEX],
	data_row[Gruff::Base::DATA_ATTRS_INDEX]
      ]
    end
    @norm_ldata_max_size = @ldata.map{ |r| r[1].size }.max
  end
def normalize_ldata return unless @has_ldata @ldata . each do | data_row | norm_data_points = [ ] data_row [ Gruff :: Base :: 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_ldata << [ data_row [ Gruff :: Base :: DATA_LABEL_INDEX ] , norm_data_points , data_row [ Gruff :: Base :: DATA_COLOR_INDEX ] , data_row [ Gruff :: Base :: DATA_ATTRS_INDEX ] ] end @norm_ldata_max_size = @ldata . map { | r | r [ 1 ] . size } . max end
Same as data, but you can defined groups of lines.
Same as data but you can defined groups of lines .
# DATA_VALUES_INDEX # max size (num data points) of any of the ldata series