Skip to content

Instantly share code, notes, and snippets.

@randym
Created August 30, 2012 04:08
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/3522227 to your computer and use it in GitHub Desktop.
Save randym/3522227 to your computer and use it in GitHub Desktop.
hide tick lables in chart
p = Axlsx::Package.new
p.workbook.add_worksheet(:name => "Bar Chart") do |sheet|
sheet.add_row ["A Simple Bar Chart"]
sheet.add_row ["First", "Second", "Third"]
sheet.add_row [1, 2, 3]
sheet.add_chart(Axlsx::Bar3DChart, :start_at => "A4", :end_at => "F17") do |chart|
chart.add_series :data => sheet["A3:C3"], :labels => sheet["A2:C2"], :title => sheet["A1"]
chart.valAxis.label_rotation = -45
chart.catAxis.label_rotation = 45
chart.d_lbls.d_lbl_pos = :outEnd
chart.d_lbls.show_val = true
chart.catAxis.tick_lbl_pos = :none
end
end
p.serialize 'no_cat_labels.xlsx'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment