lib/gruff/stacked_bar.rb in gruff-0.0.9 vs lib/gruff/stacked_bar.rb in gruff-0.1.0
- old
+ new
@@ -18,11 +18,11 @@
@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 current_color
+ @d = @d.fill data_row[DATA_COLOR_INDEX]
data_row[1].each_with_index do |data_point, point_index|
# Use incremented x and scaled y
left_x = @graph_left + (@bar_width * point_index)
left_y = @graph_top + (@graph_height -
@@ -39,10 +39,9 @@
# 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)
end
- increment_color()
end
@d.draw(@base_image)
end