lib/axlsx/drawing/line_series.rb in axlsx-1.3.5 vs lib/axlsx/drawing/line_series.rb in axlsx-1.3.6

- old
+ new

@@ -17,15 +17,20 @@ # 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] attr_reader :color + # show markers on values + # @return [Boolean] + attr_reader :show_marker + # Creates a new series # @option options [Array, SimpleTypedList] data # @option options [Array, SimpleTypedList] labels # @param [Chart] chart def initialize(chart, options={}) + @show_marker = 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 @@ -33,20 +38,33 @@ # @see color def color=(v) @color = v end + # @see show_marker + def show_marker=(v) + Axlsx::validate_boolean(v) + @show_marker = v + end + # Serializes the object # @param [String] str # @return [String] def to_xml_string(str = '') super(str) do if color str << '<c:spPr><a:solidFill>' str << '<a:srgbClr val="' << color << '"/>' - str << '</a:solidFill></c:spPr>' + 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? end end