diff options
| -rw-r--r-- | README.md | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -209,7 +209,23 @@ related to themes, which axlsx does not implement at this time. - border colors do not work 3. Numbers - - you must set 'use_shared_strings' to true + - you must set 'use_shared_strings' to true. This is most + conveniently done just before rendering by calling Package.use_shared_strings = true prior to serialization. + +```ruby +Axlsx::Package.new do |p| + p.workbook.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"], :colors => ['FF0000', '00FF00', '0000FF'] + end + end + p.use_shared_strings = true + p.serialize('simple.xlsx') +end +``` + - charts do not render |
