lib/writeexcel/charts/column.rb in writeexcel-0.4.1 vs lib/writeexcel/charts/column.rb in writeexcel-0.4.2
- old
+ new
@@ -13,10 +13,12 @@
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
#
require 'writeexcel/chart'
+module Writeexcel
+
class Chart
#
# ==SYNOPSIS
#
@@ -27,11 +29,11 @@
# require 'writeexcel'
#
# workbook = WriteExcel.new('chart.xls')
# worksheet = workbook.add_worksheet
#
- # chart = workbook.add_chart(:type => Chart::Column)
+ # chart = workbook.add_chart(:type => 'Chart::Column')
#
# # Configure the chart.
# chart.add_series(
# :categories => '=Sheet1!$A$2:$A$7',
# :values => '=Sheet1!$B$2:$B$7',
@@ -50,11 +52,11 @@
# ==DESCRIPTION
#
# This module implements Column charts for WriteExcel. The chart object is
# created via the Workbook add_chart method:
#
- # chart = workbook.add_chart(:type => Chart::Column)
+ # chart = workbook.add_chart(:type => 'Chart::Column')
#
# Once the object is created it can be configured via the following methods
# that are common to all chart classes:
#
# chart.add_series
@@ -93,11 +95,11 @@
#
# worksheet.write('A1', headings, bold)
# worksheet.write('A2', data)
#
# # Create a new chart object. In this case an embedded chart.
- # chart = workbook.add_chart(:type => Chart::Column, :embedded => 1)
+ # chart = workbook.add_chart(:type => 'Chart::Column', :embedded => 1)
#
# # Configure the first series. (Sample 1)
# chart.add_series(
# :name => 'Sample 1',
# :categories => '=Sheet1!$A$2:$A$7',
@@ -144,14 +146,11 @@
length = 0x0006 # Number of bytes to follow.
pcOverlap = 0x0000 # Space between bars.
pcGap = 0x0096 # Space between cats.
grbit = 0x0000 # Option flags.
- header = [record, length].pack('vv')
- data = [pcOverlap].pack('v')
- data += [pcGap].pack('v')
- data += [grbit].pack('v')
-
- append(header, data)
+ store_simple(record, length, pcOverlap, pcGap, grbit)
end
end
-end
+end # class Chart
+
+end # module Writeexcel