Sha256: 7e26bee866de5fc235fdd817e11bfbc807c64ecb7601a50070470967348be5cf

Contents?: true

Size: 789 Bytes

Versions: 21

Compression:

Stored size: 789 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, cxn03651@msj.biglobe.ne.jp
#

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

21 entries across 21 versions & 1 rubygems

Version Path
write_xlsx-1.00.0 examples/shape3.rb
write_xlsx-0.99.0 examples/shape3.rb
write_xlsx-0.97.0 examples/shape3.rb
write_xlsx-0.90.0 examples/shape3.rb
write_xlsx-0.89.0 examples/shape3.rb
write_xlsx-0.88.0 examples/shape3.rb
write_xlsx-0.87.0 examples/shape3.rb
write_xlsx-0.86.0 examples/shape3.rb
write_xlsx-0.85.11 examples/shape3.rb
write_xlsx-0.85.10 examples/shape3.rb
write_xlsx-0.85.9 examples/shape3.rb
write_xlsx-0.85.8 examples/shape3.rb
write_xlsx-0.85.7 examples/shape3.rb
write_xlsx-0.85.6 examples/shape3.rb
write_xlsx-0.85.5 examples/shape3.rb
write_xlsx-0.85.4 examples/shape3.rb
write_xlsx-0.85.3 examples/shape3.rb
write_xlsx-0.85.2 examples/shape3.rb
write_xlsx-0.85.1 examples/shape3.rb
write_xlsx-0.83.0 examples/shape3.rb