Class: Writeexcel::Worksheet::EmbeddedChart

Inherits:
Object
  • Object
show all
Defined in:
lib/writeexcel/embedded_chart.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(worksheet, row, col, chart, x_offset = 0, y_offset = 0, scale_x = 1, scale_y = 1) ⇒ EmbeddedChart


9
10
11
12
13
14
15
16
# File 'lib/writeexcel/embedded_chart.rb', line 9

def initialize(worksheet, row, col, chart, x_offset = 0, y_offset = 0, scale_x = 1, scale_y = 1)
  @worksheet = worksheet
  @row, @col, @chart, @x_offset, @y_offset, @scale_x, @scale_y =
    row, col, chart, x_offset, y_offset, scale_x, scale_y
  @width = default_width * scale_x
  @height = default_height * scale_y
  @vertices = calc_vertices
end

Instance Attribute Details

#chartObject (readonly)

Returns the value of attribute chart


7
8
9
# File 'lib/writeexcel/embedded_chart.rb', line 7

def chart
  @chart
end

#colObject (readonly)

Returns the value of attribute col


7
8
9
# File 'lib/writeexcel/embedded_chart.rb', line 7

def col
  @col
end

#rowObject (readonly)

Returns the value of attribute row


7
8
9
# File 'lib/writeexcel/embedded_chart.rb', line 7

def row
  @row
end

#verticesObject (readonly)

Returns the value of attribute vertices


7
8
9
# File 'lib/writeexcel/embedded_chart.rb', line 7

def vertices
  @vertices
end

Instance Method Details

#calc_verticesObject

Calculate the positions of comment object.


19
20
21
# File 'lib/writeexcel/embedded_chart.rb', line 19

def calc_vertices
  @worksheet.position_object( @col, @row, @x_offset, @y_offset, @width, @height)
end