Method: ActiveCharts::BarChart#bars_specs

Defined in:
lib/active_charts/bar_chart.rb

#bars_specsObject



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/active_charts/bar_chart.rb', line 26

def bars_specs
  collection.map.with_index do |row, row_index|
    row.map.with_index do |cell, col_index|
      height = bar_height(cell, col_index)
      x = bar_x(col_index, row_index)
      y = grid_height - height

      { height: height, x: x, y: y, class: bar_classes(col_index), val: cell, 
        formatter: data_formatters[col_index] }
    end
  end
end