class Axlsx::ScatterChart

The ScatterChart allows you to insert a scatter chart into your worksheet @see Worksheet#add_chart @see Chart#add_series @see README for an example

Attributes

scatterStyle[R]

The Style for the scatter chart must be one of :none | :line | :lineMarker | :marker | :smooth | :smoothMarker return [Symbol]

scatter_style[R]

The Style for the scatter chart must be one of :none | :line | :lineMarker | :marker | :smooth | :smoothMarker return [Symbol]

Public Class Methods

new(frame, options={}) click to toggle source

Creates a new scatter chart

Calls superclass method Axlsx::Chart::new
# File lib/axlsx/drawing/scatter_chart.rb, line 33
def initialize(frame, options={})
  @vary_colors = 0
  @scatter_style = :lineMarker

       super(frame, options)
  @series_type = ScatterSeries
  @d_lbls = nil
  parse_options options
end

Public Instance Methods

axes() click to toggle source

The axes for the scatter chart. ScatterChart has an x_val_axis and a y_val_axis @return [Axes]

# File lib/axlsx/drawing/scatter_chart.rb, line 70
def axes
  @axes ||= Axes.new(:x_val_axis => ValAxis, :y_val_axis => ValAxis)
end
scatterStyle=(v)
Alias for: scatter_style=
scatter_style=(v) click to toggle source

see scatterStyle

# File lib/axlsx/drawing/scatter_chart.rb, line 44
def scatter_style=(v)
  Axlsx.validate_scatter_style(v)
  @scatter_style = v
end
Also aliased as: scatterStyle=
to_xml_string(str = '') click to toggle source

Serializes the object @param [String] str @return [String]

Calls superclass method Axlsx::Chart#to_xml_string
# File lib/axlsx/drawing/scatter_chart.rb, line 53
def to_xml_string(str = '')
  super(str) do
    str << '<c:scatterChart>'
    str << ('<c:scatterStyle val="' << scatter_style.to_s << '"/>')
    str << ('<c:varyColors val="' << vary_colors.to_s << '"/>')
    @series.each { |ser| ser.to_xml_string(str) }
    d_lbls.to_xml_string(str) if @d_lbls
    axes.to_xml_string(str, :ids => true)
    str << '</c:scatterChart>'
    axes.to_xml_string(str)
  end
  str
end
xValAxis()
Alias for: x_val_axis
x_val_axis() click to toggle source

the x value axis @return [ValAxis]

# File lib/axlsx/drawing/scatter_chart.rb, line 20
def x_val_axis
  axes[:x_val_axis]
end
Also aliased as: xValAxis
yValAxis()
Alias for: y_val_axis
y_val_axis() click to toggle source

the y value axis @return [ValAxis]

# File lib/axlsx/drawing/scatter_chart.rb, line 27
def y_val_axis
  axes[:y_val_axis]
end
Also aliased as: yValAxis