gruffy 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gruffy/base.rb +9 -9
- data/lib/gruffy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b71279c627c87a1c9b0fc388ffcff8f1692aa21
|
4
|
+
data.tar.gz: de75567a792366e27fd4bd731905aee354ed36c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 501a0f2033e592833667a342496f22a86507d7f963612c4e997d37f7c82498e1176da4890e8a491966832f454eadd0379b377d02e0f0d682d548f60b366800a5
|
7
|
+
data.tar.gz: af27bb4eb68837bd656e8867e32bb558a68cbe4d3591cecf17744788293d3f8e0d4ec7b7eca91387e259762d8d76abd86d0b3039f6b293fd97f2827a8744c097
|
data/lib/gruffy/base.rb
CHANGED
@@ -211,7 +211,7 @@ module Gruffy
|
|
211
211
|
attr_accessor :label_rotation
|
212
212
|
|
213
213
|
# Background height of picture and ignoring content
|
214
|
-
attr_accessor :
|
214
|
+
attr_accessor :background_label_height
|
215
215
|
|
216
216
|
# With Side Bars use the data label for the marker value to the left of the bar
|
217
217
|
# Default is false
|
@@ -250,7 +250,7 @@ module Gruffy
|
|
250
250
|
# Internal for calculations
|
251
251
|
@raw_columns = 800.0
|
252
252
|
@raw_rows = 800.0 * (@rows/@columns)
|
253
|
-
@
|
253
|
+
@background_label_height = 0
|
254
254
|
@column_count = 0
|
255
255
|
@data = Array.new
|
256
256
|
@marker_count = nil
|
@@ -867,10 +867,7 @@ module Gruffy
|
|
867
867
|
end
|
868
868
|
end
|
869
869
|
|
870
|
-
|
871
|
-
y_offset += (label_size * 4) + 10 unless @label_rotation.nil?
|
872
|
-
@background_height = label_size if @background_height < label_size
|
873
|
-
|
870
|
+
y_offset += ((label_text.size - different_size) * 4) + 10 unless @label_rotation.nil?
|
874
871
|
if x_offset >= @graph_left && x_offset <= @graph_right
|
875
872
|
@d.rotation = (@label_rotation.to_i * (-1)) unless @label_rotation.nil?
|
876
873
|
@d.fill = @font_color
|
@@ -940,7 +937,8 @@ module Gruffy
|
|
940
937
|
|
941
938
|
# Make a new image at the current size with a solid +color+.
|
942
939
|
def render_solid_background(color)
|
943
|
-
@
|
940
|
+
@background_label_height = @labels.values.sort_by {|v| v.size }.last.size if @background_label_height == 0
|
941
|
+
@rows += (@background_label_height * 7) unless @label_rotation.nil?
|
944
942
|
Image.new(@columns, @rows) {
|
945
943
|
self.background_color = color
|
946
944
|
}
|
@@ -963,7 +961,8 @@ module Gruffy
|
|
963
961
|
gradient_fill = GradientFill.new(0, 0, 100, 0, top_color, bottom_color)
|
964
962
|
end
|
965
963
|
|
966
|
-
@
|
964
|
+
@background_label_height = @labels.values.sort_by {|v| v.size }.last.size if @background_label_height == 0
|
965
|
+
@rows += (@background_label_height * 7) unless @label_rotation.nil?
|
967
966
|
Image.new(@columns, @rows, gradient_fill)
|
968
967
|
end
|
969
968
|
|
@@ -978,7 +977,8 @@ module Gruffy
|
|
978
977
|
|
979
978
|
# Use with a theme to make a transparent background
|
980
979
|
def render_transparent_background
|
981
|
-
@
|
980
|
+
@background_label_height = @labels.values.sort_by {|v| v.size }.last.size if @background_label_height == 0
|
981
|
+
@rows += (@background_label_height * 7) unless @label_rotation.nil?
|
982
982
|
Image.new(@columns, @rows) do
|
983
983
|
self.background_color = 'transparent'
|
984
984
|
end
|
data/lib/gruffy/version.rb
CHANGED