<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -10,8 +10,9 @@
 == 0.6.0 2008-11-12
 
 * Continued cleanup
-* Fixed data scaling bugs
+* Changed data scaling behavior with negative values
 
 == 0.6.1 2008-11-12
 
 * Gem cleanup (switched from newgem + hoe to echoe)
+* Fixed data scaling bug with all-zero data</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -81,4 +81,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -35,7 +35,11 @@ module GoogleChart
     
     def normalize(set, encoding_max)
       min, max = scale.min, scale.max
-      set.map {|e| (e.to_f - min) / (max - min) * encoding_max if e }
+      if min != max
+        set.map {|e| (e.to_f - min) / (max - min) * encoding_max if e }
+      else
+        set
+      end
     end
     
     def simple_encode(data)</diff>
      <filename>lib/google_chart/data.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,11 +9,11 @@ Gem::Specification.new do |s|
   s.date = %q{2008-11-12}
   s.description = %q{Ruby wrapper around the Google Charts API}
   s.email = %q{jparker@urgetopunt.com}
-  s.extra_rdoc_files = [&quot;lib/google_chart/abstract_chart.rb&quot;, &quot;lib/google_chart/axis.rb&quot;, &quot;lib/google_chart/bar_chart.rb&quot;, &quot;lib/google_chart/bar_style.rb&quot;, &quot;lib/google_chart/color.rb&quot;, &quot;lib/google_chart/data.rb&quot;, &quot;lib/google_chart/grid_line.rb&quot;, &quot;lib/google_chart/legend.rb&quot;, &quot;lib/google_chart/line_chart.rb&quot;, &quot;lib/google_chart/line_style.rb&quot;, &quot;lib/google_chart/range_marker.rb&quot;, &quot;lib/google_chart/title.rb&quot;, &quot;lib/google_chart.rb&quot;, &quot;README.txt&quot;]
-  s.files = [&quot;History.txt&quot;, &quot;lib/google_chart/abstract_chart.rb&quot;, &quot;lib/google_chart/axis.rb&quot;, &quot;lib/google_chart/bar_chart.rb&quot;, &quot;lib/google_chart/bar_style.rb&quot;, &quot;lib/google_chart/color.rb&quot;, &quot;lib/google_chart/data.rb&quot;, &quot;lib/google_chart/grid_line.rb&quot;, &quot;lib/google_chart/legend.rb&quot;, &quot;lib/google_chart/line_chart.rb&quot;, &quot;lib/google_chart/line_style.rb&quot;, &quot;lib/google_chart/range_marker.rb&quot;, &quot;lib/google_chart/title.rb&quot;, &quot;lib/google_chart.rb&quot;, &quot;License.txt&quot;, &quot;Manifest&quot;, &quot;Rakefile&quot;, &quot;README.txt&quot;, &quot;ruby-googlechart.gemspec&quot;, &quot;test/google_chart/test_abstract_chart.rb&quot;, &quot;test/google_chart/test_axis.rb&quot;, &quot;test/google_chart/test_bar_chart.rb&quot;, &quot;test/google_chart/test_bar_style.rb&quot;, &quot;test/google_chart/test_color.rb&quot;, &quot;test/google_chart/test_data.rb&quot;, &quot;test/google_chart/test_grid_line.rb&quot;, &quot;test/google_chart/test_legend.rb&quot;, &quot;test/google_chart/test_line_chart.rb&quot;, &quot;test/google_chart/test_line_style.rb&quot;, &quot;test/google_chart/test_range_marker.rb&quot;, &quot;test/google_chart/test_title.rb&quot;, &quot;test/test_google_chart.rb&quot;, &quot;test/test_helper.rb&quot;]
+  s.extra_rdoc_files = [&quot;CHANGELOG&quot;, &quot;lib/google_chart/abstract_chart.rb&quot;, &quot;lib/google_chart/axis.rb&quot;, &quot;lib/google_chart/bar_chart.rb&quot;, &quot;lib/google_chart/bar_style.rb&quot;, &quot;lib/google_chart/color.rb&quot;, &quot;lib/google_chart/data.rb&quot;, &quot;lib/google_chart/grid_line.rb&quot;, &quot;lib/google_chart/legend.rb&quot;, &quot;lib/google_chart/line_chart.rb&quot;, &quot;lib/google_chart/line_style.rb&quot;, &quot;lib/google_chart/range_marker.rb&quot;, &quot;lib/google_chart/title.rb&quot;, &quot;lib/google_chart.rb&quot;, &quot;README.rdoc&quot;]
+  s.files = [&quot;CHANGELOG&quot;, &quot;lib/google_chart/abstract_chart.rb&quot;, &quot;lib/google_chart/axis.rb&quot;, &quot;lib/google_chart/bar_chart.rb&quot;, &quot;lib/google_chart/bar_style.rb&quot;, &quot;lib/google_chart/color.rb&quot;, &quot;lib/google_chart/data.rb&quot;, &quot;lib/google_chart/grid_line.rb&quot;, &quot;lib/google_chart/legend.rb&quot;, &quot;lib/google_chart/line_chart.rb&quot;, &quot;lib/google_chart/line_style.rb&quot;, &quot;lib/google_chart/range_marker.rb&quot;, &quot;lib/google_chart/title.rb&quot;, &quot;lib/google_chart.rb&quot;, &quot;Manifest&quot;, &quot;Rakefile&quot;, &quot;README.rdoc&quot;, &quot;ruby-googlechart.gemspec&quot;, &quot;test/google_chart/test_abstract_chart.rb&quot;, &quot;test/google_chart/test_axis.rb&quot;, &quot;test/google_chart/test_bar_chart.rb&quot;, &quot;test/google_chart/test_bar_style.rb&quot;, &quot;test/google_chart/test_color.rb&quot;, &quot;test/google_chart/test_data.rb&quot;, &quot;test/google_chart/test_grid_line.rb&quot;, &quot;test/google_chart/test_legend.rb&quot;, &quot;test/google_chart/test_line_chart.rb&quot;, &quot;test/google_chart/test_line_style.rb&quot;, &quot;test/google_chart/test_range_marker.rb&quot;, &quot;test/google_chart/test_title.rb&quot;, &quot;test/test_google_chart.rb&quot;, &quot;test/test_helper.rb&quot;]
   s.has_rdoc = true
   s.homepage = %q{http://github.com/jparker/ruby-googlechart}
-  s.rdoc_options = [&quot;--line-numbers&quot;, &quot;--inline-source&quot;, &quot;--title&quot;, &quot;Ruby-googlechart&quot;, &quot;--main&quot;, &quot;README.txt&quot;]
+  s.rdoc_options = [&quot;--line-numbers&quot;, &quot;--inline-source&quot;, &quot;--title&quot;, &quot;Ruby-googlechart&quot;, &quot;--main&quot;, &quot;README.rdoc&quot;]
   s.require_paths = [&quot;lib&quot;]
   s.rubyforge_project = %q{ruby-googlechart}
   s.rubygems_version = %q{1.3.1}</diff>
      <filename>ruby-googlechart.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -29,10 +29,20 @@ class TestData &lt; Test::Unit::TestCase
       assert_match(/\bchd=s:JP,YH\b/, @chart.to_url)
     end
     
-    should 'encode missing data' do
-      @chart.data = [50, nil, 33]
+    should 'encode floating point data' do
+      @chart.data = [49.5, 33.4]
       @chart.scale = 0..61
-      assert_match(/\bchd=s:y_h\b/, @chart.to_url)
+      assert_match(/\bchd=s:yh\b/, @chart.to_url)
+    end
+    
+    should 'encode all zeros with &quot;A&quot;' do
+      @chart.data = [0, 0, 0]
+      assert_match(/\bchd=s:AAA\b/, @chart.to_url)
+    end
+    
+    should 'encode unchanging non-zero data with &quot;9&quot;' do
+      @chart.data = [1, 1, 1]
+      assert_match(/\bchd=s:999\b/, @chart.to_url)
     end
     
     should 'encode out-of-bounds data' do
@@ -41,10 +51,10 @@ class TestData &lt; Test::Unit::TestCase
       assert_match(/\bchd=s:998BAA/, @chart.to_url)
     end
     
-    should 'encode floating point data' do
-      @chart.data = [49.5, 33.4]
+    should 'encode missing data' do
+      @chart.data = [50, nil, 33]
       @chart.scale = 0..61
-      assert_match(/\bchd=s:yh\b/, @chart.to_url)
+      assert_match(/\bchd=s:y_h\b/, @chart.to_url)
     end
   end
   
@@ -68,10 +78,20 @@ class TestData &lt; Test::Unit::TestCase
       assert_match(/\bchd=e:jpyh,JPYH\b/, @chart.to_url)
     end
     
-    should 'encode missing data' do
-      @chart.data = [2281, nil, 3233]
+    should 'encode floating point data' do
+      @chart.data = [2281.49, 3232.50]
       @chart.scale = 0..4095
-      assert_match(/\bchd=e:jp__yh\b/, @chart.to_url)
+      assert_match(/\bchd=e:jpyh\b/, @chart.to_url)
+    end
+    
+    should 'encode all zeros with &quot;AA&quot;' do
+      @chart.data = [0, 0, 0]
+      assert_match(/\bchd=e:AAAAAA\b/, @chart.to_url)
+    end
+    
+    should 'encode unchanging non-zero data with &quot;..&quot;' do
+      @chart.data = [1, 1, 1]
+      assert_match(/\bchd=e:\.{6}/, @chart.to_url)
     end
     
     should 'encode out-of-bounds data' do
@@ -80,10 +100,10 @@ class TestData &lt; Test::Unit::TestCase
       assert_match(/\bchd=e:\.\.\.\.\.-ABAAAA\b/, @chart.to_url)
     end
     
-    should 'encode floating point data' do
-      @chart.data = [2281.49, 3232.50]
+    should 'encode missing data' do
+      @chart.data = [2281, nil, 3233]
       @chart.scale = 0..4095
-      assert_match(/\bchd=e:jpyh\b/, @chart.to_url)
+      assert_match(/\bchd=e:jp__yh\b/, @chart.to_url)
     end
   end
   
@@ -107,10 +127,20 @@ class TestData &lt; Test::Unit::TestCase
       assert_match(/\bchd=t:6,14\|5,23\b/, @chart.to_url)
     end
     
-    should 'encode missing data' do
-      @chart.data = [6, nil, 14]
+    should 'rounds floating point data to the nearest tenth' do
+      @chart.data = [5.95, 14.01, 5.23]
       @chart.scale = 0..100
-      assert_match(/\bchd=t:6,-1,14\b/, @chart.to_url)
+      assert_match(/\bchd=t:6,14,5.2\b/, @chart.to_url)
+    end
+    
+    should 'encode all zeros with &quot;0&quot;' do
+      @chart.data = [0, 0, 0]
+      assert_match(/\bchd=t:0,0,0\b/, @chart.to_url)
+    end
+    
+    should 'encode unchanging non-zero data with &quot;100&quot;' do
+      @chart.data = [1, 1, 1]
+      assert_match(/\bchd=t:100,100,100\b/, @chart.to_url)
     end
     
     should 'encode out-of-bounds data' do
@@ -119,10 +149,10 @@ class TestData &lt; Test::Unit::TestCase
       assert_match(/\bchd=t:100,100,99,1,0,0\b/, @chart.to_url)
     end
     
-    should 'rounds floating point data to the nearest tenth' do
-      @chart.data = [5.95, 14.01, 5.23]
+    should 'encode missing data' do
+      @chart.data = [6, nil, 14]
       @chart.scale = 0..100
-      assert_match(/\bchd=t:6,14,5.2\b/, @chart.to_url)
+      assert_match(/\bchd=t:6,-1,14\b/, @chart.to_url)
     end
   end
 end</diff>
      <filename>test/google_chart/test_data.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b4d063a586411649ea91eee3f53f14568cb31a13</id>
    </parent>
  </parents>
  <author>
    <name>John Parker</name>
    <email>jparker@urgetopunt.com</email>
  </author>
  <url>http://github.com/jparker/ruby-googlechart/commit/0571b6045f50694707b8b037fc97e54e96a078b2</url>
  <id>0571b6045f50694707b8b037fc97e54e96a078b2</id>
  <committed-date>2008-11-12T22:56:53-08:00</committed-date>
  <authored-date>2008-11-12T22:56:53-08:00</authored-date>
  <message>Fixed data scaling bug with all-zero data</message>
  <tree>6a8c35a5bc9feced74949b3bc9a74d80578d2cb9</tree>
  <committer>
    <name>John Parker</name>
    <email>jparker@urgetopunt.com</email>
  </committer>
</commit>
