summaryrefslogtreecommitdiffhomepage
path: root/examples/example.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2013-03-17 15:38:55 +0900
committerRandy Morgan <[email protected]>2013-03-17 15:38:55 +0900
commitae75ef360e3e0da253188d408a3cbc81ed3897e6 (patch)
tree9bf184d72c4a78b3f14731af511aad26002a51ad /examples/example.rb
parent17f135ab215ba05b85ef92a15ed0038ea7556de9 (diff)
downloadcaxlsx-ae75ef360e3e0da253188d408a3cbc81ed3897e6.tar.gz
caxlsx-ae75ef360e3e0da253188d408a3cbc81ed3897e6.zip
Fixed LineChart and refactored chart axes management
Diffstat (limited to 'examples/example.rb')
-rwxr-xr-xexamples/example.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/example.rb b/examples/example.rb
index 70f003fc..87814b97 100755
--- a/examples/example.rb
+++ b/examples/example.rb
@@ -455,7 +455,7 @@ if examples.include? :line_chart
4.times do
sheet.add_row [ rand(24)+1, rand(24)+1]
end
- sheet.add_chart(Axlsx::Line3DChart, :title => "Simple Line Chart", :rotX => 30, :rotY => 20) do |chart|
+ sheet.add_chart(Axlsx::Line3DChart, :title => "Simple 3D Line Chart", :rotX => 30, :rotY => 20) do |chart|
chart.start_at 0, 5
chart.end_at 10, 20
chart.add_series :data => sheet["A3:A6"], :title => sheet["A2"]
@@ -463,6 +463,15 @@ if examples.include? :line_chart
chart.catAxis.title = 'X Axis'
chart.valAxis.title = 'Y Axis'
end
+ sheet.add_chart(Axlsx::LineChart, :title => "Simple Line Chart", :rotX => 30, :rotY => 20) do |chart|
+ chart.start_at 0, 21
+ chart.end_at 10, 41
+ chart.add_series :data => sheet["A3:A6"], :title => sheet["A2"]
+ chart.add_series :data => sheet["B3:B6"], :title => sheet["B2"]
+ chart.catAxis.title = 'X Axis'
+ chart.valAxis.title = 'Y Axis'
+ end
+
end
end
#```