Sha256: c74208dafeb4c712e025f3227725bfd17f20ee5332459cb38cce7e9ec1eb818c

Contents?: true

Size: 787 Bytes

Versions: 12

Compression:

Stored size: 787 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

#######################################################################
#
# A simple example of how to use the WriteXLSX gem to
# scale shapes in an Excel xlsx file.
#
# reverse('c'), May 2012, John McNamara, jmcnamara@cpan.org
# converted to Ruby by Hideo NAKAMURA, nakamura.hideo@gmail.com
#

require 'write_xlsx'

workbook  = WriteXLSX.new('shape3.xlsx')
worksheet = workbook.add_worksheet

normal = workbook.add_shape(
      :name   => 'chip',
      :type   => 'diamond',
      :text   => 'Normal',
      :width  => 100,
      :height => 100
                            )

worksheet.insert_shape('A1', normal, 50, 50)
normal.text = 'Scaled 3w x 2h'
normal.name = 'Hope'
worksheet.insert_shape('A1', normal, 250, 50, 3, 2)

workbook.close

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
write_xlsx-1.09.4 examples/shape3.rb
write_xlsx-1.09.3 examples/shape3.rb
write_xlsx-1.09.2 examples/shape3.rb
write_xlsx-1.09.1 examples/shape3.rb
write_xlsx-1.09.0 examples/shape3.rb
write_xlsx-1.08.2 examples/shape3.rb
write_xlsx-1.08.1 examples/shape3.rb
write_xlsx-1.08.0 examples/shape3.rb
write_xlsx-1.07.0 examples/shape3.rb
write_xlsx-1.04.0 examples/shape3.rb
write_xlsx-1.02.0 examples/shape3.rb
write_xlsx-1.01.0 examples/shape3.rb