Permalink
Browse files

Merge branch 'bar_updates' of github.com:BRIMIL01/gruff into bar_updates

Conflicts:
	lib/gruff/base.rb
	lib/gruff/side_stacked_bar.rb
	test/test_bar.rb
  • Loading branch information...
2 parents 5932d95 + d94d323 commit 5259be2634f090e68342be71ccd3daf70368500e @BRIMIL01 BRIMIL01 committed Nov 29, 2012
Showing with 20 additions and 1 deletion.
  1. +20 −0 lib/gruff/base.rb
  2. +0 −1 test/test_bar.rb
View
@@ -827,6 +827,26 @@ def draw_label(x_offset, index)
debug { @d.line 0.0, y_offset, @raw_columns, y_offset }
end
end
+
+ # Draws the data value over the data point in bar graphs
+ def draw_value_label(x_offset, y_offset, data_point, bar_value=false)
+ return if @hide_line_markers && !bar_value
+
+ #y_offset = @graph_bottom + LABEL_MARGIN
+
+ @d.fill = @font_color
+ @d.font = @font if @font
+ @d.stroke('transparent')
+ @d.font_weight = NormalWeight
+ @d.pointsize = scale_fontsize(@marker_font_size)
+ @d.gravity = NorthGravity
+ @d = @d.annotate_scaled(@base_image,
+ 1.0, 1.0,
+ x_offset, y_offset,
+ data_point.to_s, @scale)
+
+ debug { @d.line 0.0, y_offset, @raw_columns, y_offset }
+ end
# Draws the data value over the data point in bar graphs
def draw_value_label(x_offset, y_offset, data_point, bar_value=false)
View
@@ -444,7 +444,6 @@ def test_set_label_max_size_and_label_truncation_style
g.write("test/output/bar_set_trailing_dots_trunc.png")
end
-
def test_bar_value_labels
g = setup_basic_graph
g.show_labels_for_bar_values = true

0 comments on commit 5259be2

Please sign in to comment.