Skip to content

Instantly share code, notes, and snippets.

@randym
Created August 30, 2012 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randym/3545564 to your computer and use it in GitHub Desktop.
Save randym/3545564 to your computer and use it in GitHub Desktop.
Axlsx: Line Chart without axis labels
require 'axlsx'
p = Axlsx::Package.new
p.workbook.add_worksheet(:name => "Line Chart") do |sheet|
sheet.add_row ['1', '2', '3', '4']
sheet.add_row [1, 2, 3, '=sum(A2:C2)']
sheet.add_chart(Axlsx::Line3DChart, :start_at => [0,2], :end_at => [5, 15], :title => "Chart") do |chart|
chart.add_series :data => sheet["A2:D2"], :labels => sheet["A1:D1"]
chart.serAxis.tick_lbl_pos = :none
chart.catAxis.tick_lbl_pos = :none
chart.valAxis.tick_lbl_pos = :none
end
end
p.serialize 'line_chart.xlsx'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment