Method: Axlsx::TwoCellAnchor#initialize

Defined in:
lib/axlsx/drawing/two_cell_anchor.rb

#initialize(drawing, options = {}) ⇒ TwoCellAnchor

Note:

the chart_type parameter will be replaced with object in v. 2.0.0

Creates a new TwoCellAnchor object and sets up a reference to the from and to markers in the graphic_frame’s chart. That means that you can do stuff like c = worksheet.add_chart Axlsx::Chart c.start_at 5, 9

Parameters:

  • drawing (Drawing)
  • chart_type (Class)

    This is passed to the graphic frame for instantiation. must be Chart or a subclass of Chart

  • object

    The object this anchor holds.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • start_at (Array)

    the col, row to start at

  • end_at (Array)

    the col, row to end at



39
40
41
42
43
# File 'lib/axlsx/drawing/two_cell_anchor.rb', line 39

def initialize(drawing, options={})
  @drawing = drawing
  drawing.anchors << self
  @from, @to =  Marker.new, Marker.new(:col => 5, :row=>10)
end