Sha256: 8ec7bf9eb8ad59fb6eeb46e2e66891fccbe442286892b28377dd3f76339607e9
Contents?: true
Size: 976 Bytes
Versions: 4
Compression:
Stored size: 976 Bytes
Contents
$:.unshift(File.dirname(__FILE__)+"/../lib") require "reportbuilder" $base_dirname=File.dirname(__FILE__) rb=ReportBuilder.new(:directory=>$base_dirname) do |rb| rb.graph(:name=>"Graph", :html_engine=>:ploticus) do |g| g.series_defaults :color=>'red', :bars=>{:width=>5} g.legend :show=>true, :position=>'nw', :background_color=>'purple' g.xaxis :min=>-2, :max=>10, :ticks=>2 g.grid :show=>true, :color=>'#cccccc', :background_color=>'#eeeeee' g.serie :x1, :label=>'d1', :data=>10.times.map{|i| rand(10)+i}, :type=>:bar, :bars=>{:width=>5, :color=>'blue'} g.serie :x2, :label=>'d2', :data=>10.times.map{|i| rand(10)+i}, :type=>:scatter, :lines=>{:color=>'orange'} g.serie :x3, :label=>'d3', :data=>10.times.map{|i| rand(10)+i}, :type=>:line, :lines=>{:color=>'yellow', :width=>3, :shadow_depth=>20}, :markers=>{:show=>true, :color=>'red', :diameter=>10} end end rb.name="Graph" puts rb.to_html rb.save_html($base_dirname+'/graph.html')
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
reportbuilder-1.4.2 | examples/graph.rb |
reportbuilder-1.4.1 | examples/graph.rb |
reportbuilder-1.4.0 | examples/graph.rb |
reportbuilder-1.3.0 | examples/graph.rb |