lib/gruff/ldata_mixin.rb
# This is added to deal with having more ldata than data
This is added to deal with having more ldata than data
This is added to deal with having more ldata than data
def pre_normalize_ldata
    max_ldata_num = 0
    @ldata.each { |row|
      row_size = row[Gruff::Base::DATA_VALUES_INDEX].size
      max_ldata_num = row_size if max_ldata_num < row_size
    }
    @data.each { |row|
      vals = row[Gruff::Base::DATA_VALUES_INDEX]
      next if vals.size >= max_ldata_num
      (max_ldata_num - vals.size).times { vals.push(0) }
      @column_count = max_ldata_num if max_ldata_num > @column_count
    }
  end
def pre_normalize_ldata max_ldata_num = 0 @ldata . each { | row | row_size = row [ Gruff :: Base :: DATA_VALUES_INDEX ] . size max_ldata_num = row_size if max_ldata_num < row_size } @data . each { | row | vals = row [ Gruff :: Base :: DATA_VALUES_INDEX ] next if vals . size >= max_ldata_num ( max_ldata_num - vals . size ) . times { vals . push ( 0 ) } @column_count = max_ldata_num if max_ldata_num > @column_count } end
This is added to deal with having more ldata than data
This is added to deal with having more ldata than data
# See what the longest line data serie is # See how many data points we have in here # And make sure we have that many in at least one bar data serie