summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/drawing/line_series.rb
diff options
context:
space:
mode:
authormfrank01 <[email protected]>2014-07-29 16:11:38 -0600
committermfrank01 <[email protected]>2014-07-29 16:21:37 -0600
commit1aed4d61f773fb24d198d643ae4ae062e2789620 (patch)
tree8bb6c71a1fddd8e87420fe04130ec44cc6655dd9 /lib/axlsx/drawing/line_series.rb
parent2aec0203fcca35dcecd5dca5e9081bc6090f5e8b (diff)
downloadcaxlsx-1aed4d61f773fb24d198d643ae4ae062e2789620.tar.gz
caxlsx-1aed4d61f773fb24d198d643ae4ae062e2789620.zip
Allow custom marker symbol shapes on chart
Diffstat (limited to 'lib/axlsx/drawing/line_series.rb')
-rw-r--r--lib/axlsx/drawing/line_series.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/axlsx/drawing/line_series.rb b/lib/axlsx/drawing/line_series.rb
index 50df27b8..55b5245d 100644
--- a/lib/axlsx/drawing/line_series.rb
+++ b/lib/axlsx/drawing/line_series.rb
@@ -23,6 +23,10 @@ module Axlsx
# @return [Boolean]
attr_reader :show_marker
+ # custom marker symbol
+ # @return [String]
+ attr_reader :marker_symbol
+
# line smoothing on values
# @return [Boolean]
attr_reader :smooth
@@ -33,6 +37,7 @@ module Axlsx
# @param [Chart] chart
def initialize(chart, options={})
@show_marker = false
+ @marker_symbol = options[:marker_symbol] ? options[:marker_symbol] : :default
@smooth = false
@labels, @data = nil, nil
super(chart, options)
@@ -51,6 +56,12 @@ module Axlsx
@show_marker = v
end
+ # @see marker_symbol
+ def marker_symbol(v)
+ Axlsx::validate_marker_symbol(v)
+ @marker_symbol = v
+ end
+
# @see smooth
def smooth=(v)
Axlsx::validate_boolean(v)
@@ -74,7 +85,13 @@ module Axlsx
str << '<a:round/>'
str << '</c:spPr>'
end
- str << '<c:marker><c:symbol val="none"/></c:marker>' unless @show_marker
+
+ if !@show_marker
+ str << '<c:marker><c:symbol val="none"/></c:marker>'
+ elsif @marker_symbol != :default
+ str << '<c:marker><c:symbol val="' + @marker_symbol.to_s + '"/></c:marker>'
+ end
+
@labels.to_xml_string(str) unless @labels.nil?
@data.to_xml_string(str) unless @data.nil?
str << ('<c:smooth val="' << ((smooth) ? '1' : '0') << '"/>')