<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
 module OpenFlashChart
   class Base
-
+    attr_accessor :elements
+    attr_accessor :title
     def initialize(args={})
       # set all the instance variables we want
       # assuming something like this OpenFlashChart.new(:x_axis =&gt; 5, :y_axis =&gt; 10, :elements =&gt; [&quot;one&quot;, &quot;two&quot;], ...)
@@ -33,10 +34,27 @@ module OpenFlashChart
     end
 
     def to_json2
-      self.instance_values.to_json
+      #self.instance_values.to_json
+      self.to_renderable.to_json
     end    
 
-    alias_method :to_s, :render
+    def to_renderable
+      self.instance_values.inject({}) do |hash,key_val_arr|
+        key,val = key_val_arr
+        if key == &quot;elements&quot;
+          hash[key] = val.map{|e| e.to_renderable}
+        elsif val.class.name =~ /OpenFlashChart/
+          puts &quot;returning to_renderable on #{val.class.name} #{val.to_s}&quot;
+          hash[key] = val.to_renderable
+        else
+          puts &quot;returning val for #{val.class.name}  #{val.to_s}&quot;
+          hash[key] = val 
+        end
+        hash
+      end
+    end
+    
+    #alias_method :to_s, :render
 
     def add_element(element)
       @elements ||= []</diff>
      <filename>lib/open_flash_chart/base.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>833033459fe99e09e5894093688f9fd7ad87c2a3</id>
    </parent>
  </parents>
  <author>
    <name>klochner</name>
    <email>klochner@gmail.com</email>
  </author>
  <url>http://github.com/klochner/open_flash_chart/commit/00cf531387880af8c49ed5118737f0492b437f75</url>
  <id>00cf531387880af8c49ed5118737f0492b437f75</id>
  <committed-date>2009-10-26T12:06:09-07:00</committed-date>
  <authored-date>2009-10-26T12:06:09-07:00</authored-date>
  <message>changed the to_json2 method to be compatible with the json gem</message>
  <tree>8728d5c74a3468ae329102c6eb8d58d2be506544</tree>
  <committer>
    <name>klochner</name>
    <email>klochner@gmail.com</email>
  </committer>
</commit>
