Sha256: 773d052d6f5372bb29c47080bcfac6fcd847b1203a89d9ff4bf9457f23ef58a2

Contents?: true

Size: 552 Bytes

Versions: 10

Compression:

Stored size: 552 Bytes

Contents

require_relative '../lib/fast_excel'

workbook = FastExcel.open("example_chart.xlsx", constant_memory: true)
worksheet = workbook.add_worksheet

for i in 0..5
  for n in 0..3
    worksheet.write_number(i, n, (i + 1) * (n + 1), nil)
  end
end

chart = workbook.add_chart(Libxlsxwriter::enum_type(:chart_type)[:column])

chart.add_series("Bob", "Sheet1!$A$1:$A$5")
chart.add_series("Alice", "Sheet1!$B$1:$B$5")
chart.add_series("Montgomery", "Sheet1!$C$1:$C$5")

worksheet.insert_chart(1, 7, chart)

workbook.close
puts "Saved to file example_chart.xlsx"

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
fast_excel-0.5.0 examples/example_chart.rb
fast_excel-0.4.1 examples/example_chart.rb
fast_excel-0.4.0 examples/example_chart.rb
fast_excel-0.3.0 examples/example_chart.rb
fast_excel-0.2.6 examples/example_chart.rb
fast_excel-0.2.5 examples/example_chart.rb
fast_excel-0.2.3 examples/example_chart.rb
fast_excel-0.2.2 examples/example_chart.rb
kmadej_fast_excel_fork-0.2.2 examples/example_chart.rb
fast_excel-0.2.1 examples/example_chart.rb