examples/example.rb in axlsx-1.1.8 vs examples/example.rb in axlsx-1.2.0
- old
+ new
@@ -236,11 +236,11 @@
#```ruby
wb.add_worksheet(:name => "Pie Chart") do |sheet|
sheet.add_row ["Simple Pie Chart"]
%w(first second third).each { |label| sheet.add_row [label, rand(24)+1] }
sheet.add_chart(Axlsx::Pie3DChart, :start_at => [0,5], :end_at => [10, 20], :title => "example 3: Pie Chart") do |chart|
- chart.add_series :data => sheet["B2:B4"], :labels => sheet["A2:A4"]
+ chart.add_series :data => sheet["B2:B4"], :labels => sheet["A2:A4"], :colors => ['FF0000', '00FF00', '0000FF']
end
end
#```
##Generating A Line Chart
@@ -312,9 +312,15 @@
sheet.add_row ["This", "Sheet", "Hides", "Gridlines"]
sheet.show_gridlines = false
end
##```
+#```ruby
+wb.add_worksheet(:name => "repeated header") do |sheet|
+ sheet.add_row %w(These Column Header Will Render On Every Printed Sheet)
+ 200.times { sheet.add_row %w(1 2 3 4 5 6 7 8) }
+ wb.add_defined_name("'repeated header'!$1:$1", :local_sheet_id => sheet.index, :name => '_xlnm.Print_Titles')
+end
# Sheet Protection and excluding cells from locking.
unlocked = wb.styles.add_style :locked => false
wb.add_worksheet(:name => 'Sheet Protection') do |sheet|
sheet.sheet_protection.password = 'fish'