lilygraph 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/lilygraph.rb +10 -1
- data/lilygraph.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
data/lib/lilygraph.rb
CHANGED
@@ -167,7 +167,7 @@ class Lilygraph
|
|
167
167
|
end
|
168
168
|
|
169
169
|
# Bars
|
170
|
-
xml.g 'font-size' => '
|
170
|
+
xml.g 'font-size' => '10px', 'stroke-width' => 0.3 do |xml|
|
171
171
|
@data.each_with_index do |data, data_index|
|
172
172
|
data = Array(data)
|
173
173
|
width = dx - @options[:padding]
|
@@ -201,6 +201,7 @@ class Lilygraph
|
|
201
201
|
|
202
202
|
# Text
|
203
203
|
if @options[:bar_text]
|
204
|
+
last_bar_height = false
|
204
205
|
data.each_with_index do |number, number_index|
|
205
206
|
height = ((dy / 10.0) * number).round
|
206
207
|
|
@@ -210,6 +211,14 @@ class Lilygraph
|
|
210
211
|
bar_y = @options[:viewbox][:height] - @options[:margin][:bottom] - height
|
211
212
|
text_y = bar_y - 3
|
212
213
|
|
214
|
+
if last_bar_height && (last_bar_height < (number + 5) && last_bar_height > (number - 5))
|
215
|
+
text_y -= (14 - ((number - last_bar_height) * (dy / 10.0)))
|
216
|
+
last_bar_height = false
|
217
|
+
else
|
218
|
+
last_bar_height = number
|
219
|
+
end
|
220
|
+
|
221
|
+
# xml.text number, :x => text_x, :y => text_y + 1, 'text-anchor' => 'middle', 'font-size' => '13px', 'stroke-width' => 1.0, :fill => '#ffffff', :stroke => '#ffffff'
|
213
222
|
xml.text number, :x => text_x, :y => text_y, 'text-anchor' => 'middle'
|
214
223
|
end
|
215
224
|
end
|
data/lilygraph.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{lilygraph}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Christopher Giroir"]
|
12
|
-
s.date = %q{2009-08-
|
12
|
+
s.date = %q{2009-08-24}
|
13
13
|
s.description = %q{Lilygraph is a Ruby library for creating svg charts and graphs based on XmlBuilder.}
|
14
14
|
s.email = %q{kelsin@valefor.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lilygraph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Giroir
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-24 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|