Changeset 1243

Show
Ignore:
Timestamp:
01/02/08 02:47:52 (11 months ago)
Author:
sandal
Message:

Example update

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ruport-www/examples.html

    r1129 r1243  
    138138  require "ruport/util" 
    139139 
    140   class GraphReport < Ruport::Report 
     140  class GraphReport < Ruport::Report  
    141141 
    142142    renders_as_graph 
    143143 
    144     def generate 
    145       graph = Ruport::Graph(:column_names => %w[a b c d e]) 
    146       graph.add_line [1,2,3,4,5], :name => "foo"  
    147       graph.add_line [11,22,70,2,19], :name => "bar" 
     144    def renderable_data(format) 
     145      graph = Graph(%w[a b c d e]) 
     146      graph.series [1,2,3,4,5], "foo"  
     147      graph.series [11,22,70,2,19], "bar" 
    148148      return graph 
    149149    end 
    150150 
     151  end                                 
     152 
     153  GraphReport.generate do |r|  
     154    r.save_as("foo.svg", :template => :graph) 
    151155  end 
    152  
    153   GraphReport.generate { |r| r.save_as("foo.svg") }   
    154156</pre> 
    155157