lib/gruff/stacked_bar.rb in gruff-0.3.1 vs lib/gruff/stacked_bar.rb in gruff-0.3.3
- old
+ new
@@ -19,13 +19,13 @@
@d = @d.stroke_opacity 0.0
height = Array.new(@column_count, 0)
- @norm_data.each_with_index do |data_row, row_index|
- @d = @d.fill data_row[DATA_COLOR_INDEX]
-
- data_row[1].each_with_index do |data_point, point_index|
+ @norm_data.each_with_index do |data_row, row_index|
+ data_row[DATA_VALUES_INDEX].each_with_index do |data_point, point_index|
+ @d = @d.fill data_row[DATA_COLOR_INDEX]
+
# Calculate center based on bar_width and current row
label_center = @graph_left + (@bar_width * point_index) + (@bar_width * spacing_factor / 2.0)
draw_label(label_center, point_index)
next if (data_point == 0)