Sha256: 36072fdd28620c3fbbd1e341103f564ca488e59154cff812cbd49e0542763175

Contents?: true

Size: 818 Bytes

Versions: 16

Compression:

Stored size: 818 Bytes

Contents

# 3D Pie graph
 require 'rubygems'
 require 'rchart'

 p = Rdata.new
 p.add_point([10,2,3,5,3],"Serie1")
 p.add_point(["January","February","March","April","May"],"Serie2")
 p.add_all_series
 p.set_abscise_label_serie("Serie2")

 ch = Rchart.new(420,250)
 ch.draw_filled_rounded_rectangle(7,7,413,243,5,240,240,240)
 ch.draw_rounded_rectangle(5,5,415,245,5,230,230,230)
 ch.create_color_gradient_palette(195,204,56,223,110,41,5)
 ch.set_font_properties("tahoma.ttf",8)
 ch.antialias_quality=0

 ch.draw_pie_graph(p.get_data,p.get_data_description,180,130,110,Rchart::PIE_PERCENTAGE_LABEL,false,50,20,5)
 ch.draw_pie_legend(330,15,p.get_data,p.get_data_description,250,250,250)

 #Write the title
 ch.set_font_properties("MankSans.ttf",10)
 ch.draw_title(10,20,"Sales per month",100,100,100)
 ch.render_png("example8")

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
rchart-2.0.9 examples/example8.rb
rchart-2.0.8 examples/example8.rb
rchart-2.0.7 examples/example8.rb
rchart-2.0.6 examples/example8.rb
rchart-2.0.4 examples/example8.rb
rchart-1.2.2 examples/example8.rb
rchart-2.0.2 examples/example8.rb
rchart-1.2.1 examples/example8.rb
rchart-1.2.0 examples/example8.rb
rchart-2.0.1 examples/example8.rb
rchart-1.1.4 examples/example8.rb
rchart-1.1.3 examples/example8.rb
rchart-1.1.2 examples/example8.rb
rchart-1.1.1 examples/example8.rb
rchart-1.1.0 examples/example8.rb
rchart-1.0.0 examples/example8.rb