Class: Writexlsx::Chart::Errorbars

Inherits:
Object
  • Object
show all
Includes:
Utility::ChartFormatting
Defined in:
lib/write_xlsx/chart/series.rb

Constant Summary

Constants included from Utility::ChartFormatting

Utility::ChartFormatting::PATTERN_TYPES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utility::ChartFormatting

#color, #dash_types, #fill_properties, #layout_properties, #legend_properties, #line_fill_properties, #line_properties, #palette_color_from_index, #pattern_properties, #value_or_raise, #write_a_solid_fill, #write_a_srgb_clr

Constructor Details

#initialize(params) ⇒ Errorbars

Returns a new instance of Errorbars.



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/write_xlsx/chart/series.rb', line 189

def initialize(params)
  @type = types[params[:type].to_sym] || 'fixedVal'
  @value = params[:value] || 1    # value for error types that require it.
  @endcap = params[:end_style] || 1 # end-cap style.

  # Set the error bar direction.
  @direction = error_bar_direction(params[:direction])

  # Set any custom values
  @plus_values  = params[:plus_values]  || [1]
  @minus_values = params[:minus_values] || [1]
  @plus_data    = params[:plus_data]    || []
  @minus_data   = params[:minus_data]   || []

  # Set the line properties for the error bars.
  @line = line_properties(params[:line])
  @fill = params[:fill]
end

Instance Attribute Details

#directionObject (readonly)

Returns the value of attribute direction.



186
187
188
# File 'lib/write_xlsx/chart/series.rb', line 186

def direction
  @direction
end

#endcapObject (readonly)

Returns the value of attribute endcap.



186
187
188
# File 'lib/write_xlsx/chart/series.rb', line 186

def endcap
  @endcap
end

#fillObject (readonly)

Returns the value of attribute fill.



186
187
188
# File 'lib/write_xlsx/chart/series.rb', line 186

def fill
  @fill
end

#lineObject (readonly)

Returns the value of attribute line.



186
187
188
# File 'lib/write_xlsx/chart/series.rb', line 186

def line
  @line
end

#minus_dataObject (readonly)

Returns the value of attribute minus_data.



187
188
189
# File 'lib/write_xlsx/chart/series.rb', line 187

def minus_data
  @minus_data
end

#minus_valuesObject (readonly)

Returns the value of attribute minus_values.



187
188
189
# File 'lib/write_xlsx/chart/series.rb', line 187

def minus_values
  @minus_values
end

#plus_dataObject (readonly)

Returns the value of attribute plus_data.



187
188
189
# File 'lib/write_xlsx/chart/series.rb', line 187

def plus_data
  @plus_data
end

#plus_valuesObject (readonly)

Returns the value of attribute plus_values.



187
188
189
# File 'lib/write_xlsx/chart/series.rb', line 187

def plus_values
  @plus_values
end

#typeObject (readonly)

Returns the value of attribute type.



186
187
188
# File 'lib/write_xlsx/chart/series.rb', line 186

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



186
187
188
# File 'lib/write_xlsx/chart/series.rb', line 186

def value
  @value
end