Class: Writexlsx::InsertedChart
- Inherits:
-
Object
- Object
- Writexlsx::InsertedChart
- Includes:
- Utility::Common
- Defined in:
- lib/write_xlsx/inserted_chart.rb
Constant Summary
Constants included from Utility::Common
Utility::Common::PERL_TRUE_VALUES
Instance Attribute Summary collapse
-
#anchor ⇒ Object
readonly
Returns the value of attribute anchor.
-
#chart ⇒ Object
readonly
Returns the value of attribute chart.
-
#col ⇒ Object
readonly
Returns the value of attribute col.
-
#decorative ⇒ Object
readonly
Returns the value of attribute decorative.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
-
#x_offset ⇒ Object
readonly
Returns the value of attribute x_offset.
-
#x_scale ⇒ Object
readonly
Returns the value of attribute x_scale.
-
#y_offset ⇒ Object
readonly
Returns the value of attribute y_offset.
-
#y_scale ⇒ Object
readonly
Returns the value of attribute y_scale.
Instance Method Summary collapse
-
#initialize(row, col, chart, x_offset, y_offset, x_scale, y_scale, anchor, description, decorative) ⇒ InsertedChart
constructor
A new instance of InsertedChart.
- #name ⇒ Object
- #scaled_height ⇒ Object
- #scaled_width ⇒ Object
Methods included from Utility::Common
#absolute_char, #check_parameter, #float_to_str, #ptrue?, #put_deprecate_message
Constructor Details
#initialize(row, col, chart, x_offset, y_offset, x_scale, y_scale, anchor, description, decorative) ⇒ InsertedChart
Returns a new instance of InsertedChart.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/write_xlsx/inserted_chart.rb', line 12 def initialize( row, col, chart, x_offset, y_offset, x_scale, y_scale, anchor, description, decorative ) @row = row @col = col @chart = chart @x_offset = x_offset @y_offset = y_offset @x_scale = x_scale || 0 @y_scale = y_scale || 0 @anchor = anchor @description = description @decorative = decorative end |
Instance Attribute Details
#anchor ⇒ Object (readonly)
Returns the value of attribute anchor.
10 11 12 |
# File 'lib/write_xlsx/inserted_chart.rb', line 10 def anchor @anchor end |
#chart ⇒ Object (readonly)
Returns the value of attribute chart.
8 9 10 |
# File 'lib/write_xlsx/inserted_chart.rb', line 8 def chart @chart end |
#col ⇒ Object (readonly)
Returns the value of attribute col.
8 9 10 |
# File 'lib/write_xlsx/inserted_chart.rb', line 8 def col @col end |
#decorative ⇒ Object (readonly)
Returns the value of attribute decorative.
10 11 12 |
# File 'lib/write_xlsx/inserted_chart.rb', line 10 def decorative @decorative end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
10 11 12 |
# File 'lib/write_xlsx/inserted_chart.rb', line 10 def description @description end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
8 9 10 |
# File 'lib/write_xlsx/inserted_chart.rb', line 8 def row @row end |
#x_offset ⇒ Object (readonly)
Returns the value of attribute x_offset.
8 9 10 |
# File 'lib/write_xlsx/inserted_chart.rb', line 8 def x_offset @x_offset end |
#x_scale ⇒ Object (readonly)
Returns the value of attribute x_scale.
9 10 11 |
# File 'lib/write_xlsx/inserted_chart.rb', line 9 def x_scale @x_scale end |
#y_offset ⇒ Object (readonly)
Returns the value of attribute y_offset.
8 9 10 |
# File 'lib/write_xlsx/inserted_chart.rb', line 8 def y_offset @y_offset end |
#y_scale ⇒ Object (readonly)
Returns the value of attribute y_scale.
9 10 11 |
# File 'lib/write_xlsx/inserted_chart.rb', line 9 def y_scale @y_scale end |
Instance Method Details
#name ⇒ Object
28 29 30 |
# File 'lib/write_xlsx/inserted_chart.rb', line 28 def name chart.name end |
#scaled_height ⇒ Object
37 38 39 40 |
# File 'lib/write_xlsx/inserted_chart.rb', line 37 def scaled_height height = chart.height if ptrue?(chart.height) (0.5 + (height * y_scale)).to_i end |
#scaled_width ⇒ Object
32 33 34 35 |
# File 'lib/write_xlsx/inserted_chart.rb', line 32 def scaled_width width = chart.width if ptrue?(chart.width) (0.5 + (width * x_scale)).to_i end |