class Axlsx::ScatterSeries

A ScatterSeries defines the x and y position of data in the chart @note The recommended way to manage series is to use Chart#add_series @see Worksheet#add_chart @see Chart#add_series @see examples/example.rb

Attributes

color[R]

The fill color for this series. Red, green, and blue is expressed as sequence of hex digits, RRGGBB. A perceptual gamma of 2.2 is used. @return [String]

xData[R]

The x data for this series. @return [NamedAxisData]

yData[R]

The y data for this series. @return [NamedAxisData]

Public Class Methods

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

Creates a new ScatterSeries

Calls superclass method
# File lib/axlsx/drawing/scatter_series.rb, line 25
def initialize(chart, options={})
  @xData, @yData = nil
  super(chart, options)
  @xData = AxDataSource.new(:tag_name => :xVal, :data => options[:xData]) unless options[:xData].nil?
  @yData = NumDataSource.new({:tag_name => :yVal, :data => options[:yData]}) unless options[:yData].nil?
end

Public Instance Methods

color=(v) click to toggle source

@see color

# File lib/axlsx/drawing/scatter_series.rb, line 33
def color=(v)
  @color = v
end
to_xml_string(str = '') click to toggle source

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

Calls superclass method
# File lib/axlsx/drawing/scatter_series.rb, line 40
def to_xml_string(str = '')
  super(str) do
    # needs to override the super color here to push in ln/and something else!
    if color
      str << '<c:spPr><a:solidFill>'
      str << ('<a:srgbClr val="' << color << '"/>')
      str << '</a:solidFill>'
      str << '<a:ln><a:solidFill>'
      str << ('<a:srgbClr val="' << color << '"/></a:solidFill></a:ln>')
      str << '</c:spPr>'
      str << '<c:marker>'
      str << '<c:spPr><a:solidFill>'
      str << ('<a:srgbClr val="' << color << '"/>')
      str << '</a:solidFill>'
      str << '<a:ln><a:solidFill>'
      str << ('<a:srgbClr val="' << color << '"/></a:solidFill></a:ln>')
      str << '</c:spPr>'
      str << '</c:marker>'
    end
    @xData.to_xml_string(str) unless @xData.nil?
    @yData.to_xml_string(str) unless @yData.nil?
  end
  str
end