lilygraph 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/lilygraph.rb +5 -5
  3. data/lilygraph.gemspec +2 -2
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
data/lib/lilygraph.rb CHANGED
@@ -35,7 +35,7 @@ class Lilygraph
35
35
 
36
36
  # This is the data for the graph. It should be an array where every item is
37
37
  # either a number or an array of numbers.
38
- #
38
+ #
39
39
  # For a simple bar graph:
40
40
  # graph.data=[1,2,3]
41
41
  # For a grouped bar graph:
@@ -57,7 +57,7 @@ class Lilygraph
57
57
  # number_index: The index of the current bar INSIDE of the current bar group (always 0 if you don't have grouped bars)
58
58
  # data_size: total number of bar or groups.
59
59
  # number_size: total number of bars in the current group (always 1 if you don't have bar groups)
60
- #
60
+ #
61
61
  # The default proc looks like:
62
62
  # graph.colors=Proc.new do |data_index, number_index, data_size, number_size|
63
63
  # Color::HSL.from_fraction(Float(data_index) / Float(data_size), 1.0, 0.4 + (Float(number_index) / Float(number_size) * 0.4)).to_rgb.html
@@ -185,7 +185,7 @@ class Lilygraph
185
185
  @colors.call(data_index, number_index, @data.size, data.size)
186
186
  elsif @colors.class == Array
187
187
  first = @colors[data_index % (@colors.size)]
188
-
188
+
189
189
  if first.class == Array
190
190
  first[number_index % (first.size)]
191
191
  else
@@ -211,7 +211,7 @@ class Lilygraph
211
211
  end
212
212
  xml.circle :cx => bar_x, :cy => bar_y, :fill => color, :stroke => color, :r => bar_width * 1.5
213
213
  end
214
-
214
+
215
215
  last_spot[number_index] = { :x => bar_x, :y => bar_y }
216
216
  end
217
217
  end
@@ -295,7 +295,7 @@ class Lilygraph
295
295
  end
296
296
 
297
297
  def division
298
- (10 ** Math.log10(data_max).floor) / 10
298
+ [(10 ** Math.log10(data_max).floor) / 10, 1].max
299
299
  end
300
300
 
301
301
  def max
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.5.1"
8
+ s.version = "0.5.2"
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-26}
12
+ s.date = %q{2009-09-10}
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.5.1
4
+ version: 0.5.2
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-26 00:00:00 -04:00
12
+ date: 2009-09-10 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency