Skip to content

Commit

Permalink
Add Scatter Chart example.
Browse files Browse the repository at this point in the history
  • Loading branch information
joekain committed Mar 24, 2012
1 parent 8a0f840 commit e9bfaf8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit e9bfaf8

Please sign in to comment.