lib/gruff/side_stacked_bar.rb in gruff-0.0.9 vs lib/gruff/side_stacked_bar.rb in gruff-0.1.0
- old
+ new
@@ -72,11 +72,11 @@
@d = @d.stroke_opacity 0.0
height = Array.new(@column_count, 0)
length = Array.new(@column_count, @graph_left)
@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|
## using the original calcs from the stacked bar chart to get the difference between
## part of the bart chart we wish to stack.
@@ -98,10 +98,9 @@
# Calculate center based on bar_width and current row
label_center = @graph_top + (@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