<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -22,13 +22,18 @@ module OpenFlashChart
       # 7) grid_colour as grid-colour
       # 8) threed as 3d
       # 9) tick_length as tick-length
-      returning self.to_json.gsub(&quot;threed&quot;,&quot;3d&quot;) do |output|
+      returning self.to_json do |output|
+        output.gsub!(&quot;threed&quot;,&quot;3d&quot;)
         %w(font_size dot_size outline_colour halo_size start_angle tick_height grid_colour tick_length no_labels label_colour gradient_fill fill_alpha on_click spoke_labels).each do |replace|
           output.gsub!(replace, replace.gsub(&quot;_&quot;, &quot;-&quot;))
         end
       end
     end
-    # for those still using to_s and that do not get a stack overflow
+
+    def to_json
+      self.instance_values.to_json
+    end    
+
     alias_method :to_s, :render
 
     def add_element(element)
@@ -77,19 +82,21 @@ module OpenFlashChart
     alias_method &quot;tooltip=&quot;, :set_tooltip
 
 
+
     def method_missing(method_name, *args, &amp;blk)
-      method_name = method_name.to_s
-      if method_name =~ /(.*)=/   # i.e., if it is something x_legend=
+      case method_name.to_s
+      when /(.*)=/   # i.e., if it is something x_legend=
         # if the user wants to set an instance variable then let them
         # the other args (args[0]) are ignored since it is a set method
-        return self.instance_variable_set(&quot;@#{$1}&quot;, args[0])
-      elsif method_name =~/^set_(.*)/
+        self.instance_variable_set(&quot;@#{$1}&quot;, args[0])
+      when /^set_(.*)/
         # backwards compatible ... the user can still use the same set_y_legend methods if they want
-        return self.instance_variable_set(&quot;@#{$1}&quot;, args[0])
+        self.instance_variable_set(&quot;@#{$1}&quot;, args[0])
       else
         # if the method/attribute is missing and it is not a set method then hmmmm better let the user know
         super
       end
     end
+
   end
 end
\ No newline at end of file</diff>
      <filename>lib/open_flash_chart/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ class TestItController &lt; ApplicationController
         @graph = open_flash_chart_object( 600, 300, url_for( :action =&gt; 'index', :format =&gt; :json ) )
       }
       wants.json { 
-        chart = OpenFlashChart::Base.new( :title =&gt; Title.new(&quot;MY TITLE&quot;) ) do |c|
+        chart = OpenFlashChart::Chart.new( &quot;MY TITLE&quot; ) do |c|
           c &lt;&lt; BarGlass.new( :values =&gt; (1..10).sort_by{rand} )
         end
         render :text =&gt; chart, :layout =&gt; false</diff>
      <filename>test/RAILS_ROOT/app/controllers/test_it_controller.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ca9a94e76c063b9ee2d4ecfd56840312eddf3645</id>
    </parent>
  </parents>
  <author>
    <name>David Lowenfels</name>
    <email>david@internautdesign.com</email>
  </author>
  <url>http://github.com/dfl/open_flash_chart/commit/95983957d727486ee4d7463972202287cf31c730</url>
  <id>95983957d727486ee4d7463972202287cf31c730</id>
  <committed-date>2008-10-27T10:17:04-07:00</committed-date>
  <authored-date>2008-10-27T10:17:04-07:00</authored-date>
  <message>fixing stack overflow bug</message>
  <tree>ca9bacb89a032841d2500907892e889bb202671a</tree>
  <committer>
    <name>David Lowenfels</name>
    <email>david@internautdesign.com</email>
  </committer>
</commit>
