Permalink
Browse files

Add Scatter Chart example.

  • Loading branch information...
1 parent 8a0f840 commit e9bfaf8ddbb1995da906dbca6b650ff06b4afe75 @joekain committed Mar 24, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 examples/example.rb
View
@@ -210,6 +210,21 @@
end
end
+##Generating A Scatter Chart
+
+wb.add_worksheet(:name => "Scatter Chart") do |sheet|
+ sheet.add_row ["First", 1, 5, 7, 9]
+ sheet.add_row ["", 1, 25, 49, 81]
+ sheet.add_row ["Second", 5, 2, 14, 9]
+ sheet.add_row ["", 5, 10, 15, 20]
+ sheet.add_chart(Axlsx::ScatterChart, :title => "example 7: Scatter Chart") do |chart|
+ chart.start_at 0, 4
+ chart.end_at 10, 19
+ chart.add_series :xData => sheet["B1:E1"], :yData => sheet["B2:E2"], :title => sheet["A1"]
+ chart.add_series :xData => sheet["B3:E3"], :yData => sheet["B4:E4"], :title => sheet["A3"]
+ end
+end
+
##Auto Filter
wb.add_worksheet(:name => "Auto Filter") do |sheet|

0 comments on commit e9bfaf8

Please sign in to comment.