class Axlsx::LineSeries
A LineSeries
defines the title, data and labels for line charts @note The recommended way to manage series is to use Chart#add_series
@see Worksheet#add_chart
@see Chart#add_series
Attributes
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]
The data for this series. @return [ValAxisData]
The labels for this series. @return [CatAxisData]
show markers on values @return [Boolean]
line smoothing on values @return [Boolean]
Public Class Methods
Creates a new series @option options [Array, SimpleTypedList] data @option options [Array, SimpleTypedList] labels @param [Chart] chart
# File lib/axlsx/drawing/line_series.rb, line 34 def initialize(chart, options={}) @show_marker = false @smooth = false @labels, @data = nil, nil super(chart, options) @labels = AxDataSource.new(:data => options[:labels]) unless options[:labels].nil? @data = NumDataSource.new(options) unless options[:data].nil? end
Public Instance Methods
@see color
# File lib/axlsx/drawing/line_series.rb, line 44 def color=(v) @color = v end
@see show_marker
# File lib/axlsx/drawing/line_series.rb, line 49 def show_marker=(v) Axlsx::validate_boolean(v) @show_marker = v end
@see smooth
# File lib/axlsx/drawing/line_series.rb, line 55 def smooth=(v) Axlsx::validate_boolean(v) @smooth = v end
Serializes the object @param [String] str @return [String]
# File lib/axlsx/drawing/line_series.rb, line 63 def to_xml_string(str = '') super(str) do if color str << '<c:spPr><a:solidFill>' str << ('<a:srgbClr val="' << color << '"/>') str << '</a:solidFill>' str << '<a:ln w="28800">' str << '<a:solidFill>' str << ('<a:srgbClr val="' << color << '"/>') str << '</a:solidFill>' str << '</a:ln>' str << '<a:round/>' str << '</c:spPr>' end str << '<c:marker><c:symbol val="none"/></c:marker>' unless @show_marker @labels.to_xml_string(str) unless @labels.nil? @data.to_xml_string(str) unless @data.nil? str << ('<c:smooth val="' << ((smooth) ? '1' : '0') << '"/>') end end
Private Instance Methods
assigns the data for this series
# File lib/axlsx/drawing/line_series.rb, line 87 def data=(v) DataTypeValidator.validate "Series.data", [NumDataSource], v; @data = v; end
assigns the labels for this series
# File lib/axlsx/drawing/line_series.rb, line 90 def labels=(v) DataTypeValidator.validate "Series.labels", [AxDataSource], v; @labels = v; end