Class: Writexlsx::Chart::Caption

Inherits:
Object
  • Object
show all
Includes:
Utility::Common, Utility::RichText
Defined in:
lib/write_xlsx/chart/caption.rb

Constant Summary

Constants included from Utility::Common

Utility::Common::PERL_TRUE_VALUES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utility::RichText

#convert_font_args, #get_font_latin_attributes, #get_font_style_attributes, #params_to_font, #underline_attributes, #write_a_body_pr, #write_a_def_rpr, #write_a_end_para_rpr, #write_a_lst_style, #write_a_p_formula, #write_a_p_pr_formula, #write_def_rpr_r_pr_common, #write_tx_pr

Methods included from Utility::Common

#absolute_char, #check_parameter, #float_to_str, #ptrue?, #put_deprecate_message

Constructor Details

#initialize(chart) ⇒ Caption

Returns a new instance of Caption.



14
15
16
# File 'lib/write_xlsx/chart/caption.rb', line 14

def initialize(chart)
  @chart = chart
end

Instance Attribute Details

#data_idObject

Returns the value of attribute data_id.



10
11
12
# File 'lib/write_xlsx/chart/caption.rb', line 10

def data_id
  @data_id
end

#fillObject

Returns the value of attribute fill.



11
12
13
# File 'lib/write_xlsx/chart/caption.rb', line 11

def fill
  @fill
end

#fontObject

Returns the value of attribute font.



10
11
12
# File 'lib/write_xlsx/chart/caption.rb', line 10

def font
  @font
end

#formulaObject

Returns the value of attribute formula.



10
11
12
# File 'lib/write_xlsx/chart/caption.rb', line 10

def formula
  @formula
end

#gradientObject

Returns the value of attribute gradient.



11
12
13
# File 'lib/write_xlsx/chart/caption.rb', line 11

def gradient
  @gradient
end

#layoutObject (readonly)

Returns the value of attribute layout.



12
13
14
# File 'lib/write_xlsx/chart/caption.rb', line 12

def layout
  @layout
end

#lineObject

Returns the value of attribute line.



11
12
13
# File 'lib/write_xlsx/chart/caption.rb', line 11

def line
  @line
end

#nameObject

Returns the value of attribute name.



10
11
12
# File 'lib/write_xlsx/chart/caption.rb', line 10

def name
  @name
end

#noneObject (readonly)

Returns the value of attribute none.



12
13
14
# File 'lib/write_xlsx/chart/caption.rb', line 12

def none
  @none
end

#overlayObject (readonly)

Returns the value of attribute overlay.



12
13
14
# File 'lib/write_xlsx/chart/caption.rb', line 12

def overlay
  @overlay
end

#patternObject

Returns the value of attribute pattern.



11
12
13
# File 'lib/write_xlsx/chart/caption.rb', line 11

def pattern
  @pattern
end

Instance Method Details

#apply_format_options(params) ⇒ Object



29
30
31
32
33
34
# File 'lib/write_xlsx/chart/caption.rb', line 29

def apply_format_options(params)
  @line     = chart.line_properties(params[:border] || params[:line])
  @fill     = chart.fill_properties(params[:fill])
  @pattern  = chart.pattern_properties(params[:pattern])
  @gradient = chart.gradient_properties(params[:gradient])
end

#apply_text_options(params) ⇒ Object

:nodoc:



18
19
20
21
22
23
24
25
26
27
# File 'lib/write_xlsx/chart/caption.rb', line 18

def apply_text_options(params) # :nodoc:
  @name, @formula = chart.process_names(params[:name], params[:name_formula])
  @name = nil if @name.respond_to?(:empty?) && @name.empty?
  @data_id = chart.data_id(@formula, params[:data])
  @font     = convert_font_args(params[:font] || params[:name_font])

  @layout   = chart.layout_properties(params[:layout], 1)
  @overlay  = params[:overlay]
  @none     = params[:none]
end