diff options
| author | Randy Morgan <[email protected]> | 2012-04-01 00:35:26 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-04-01 00:35:26 +0900 |
| commit | 22a341841f191a5aa00e87b1f166b4f25cc67f0a (patch) | |
| tree | 505f46708d5cac7d33d0dd6679c125e2eb819075 /lib/axlsx/drawing/line_3D_chart.rb | |
| parent | bb2117ba17297e02a0fc6d5ad5a22462e72a9a79 (diff) | |
| download | caxlsx-22a341841f191a5aa00e87b1f166b4f25cc67f0a.tar.gz caxlsx-22a341841f191a5aa00e87b1f166b4f25cc67f0a.zip | |
part way through changing all serialization to use string concatenation prior to dropping Nokogiri dep in production.
Diffstat (limited to 'lib/axlsx/drawing/line_3D_chart.rb')
| -rw-r--r-- | lib/axlsx/drawing/line_3D_chart.rb | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/lib/axlsx/drawing/line_3D_chart.rb b/lib/axlsx/drawing/line_3D_chart.rb index 13e42dff..bd587d1b 100644 --- a/lib/axlsx/drawing/line_3D_chart.rb +++ b/lib/axlsx/drawing/line_3D_chart.rb @@ -44,11 +44,11 @@ module Axlsx # validation regex for gap amount percent GAP_AMOUNT_PERCENT = /0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/ - + # Creates a new line chart object # @param [GraphicFrame] frame The workbook that owns this chart. # @option options [Cell, String] title - # @option options [Boolean] show_legend + # @option options [Boolean] show_legend # @option options [Symbol] grouping # @option options [String] gapDepth # @option options [Integer] rotX @@ -68,7 +68,7 @@ module Axlsx @catAxis = CatAxis.new(@catAxId, @valAxId) @valAxis = ValAxis.new(@valAxId, @catAxId) @serAxis = SerAxis.new(@serAxId, @valAxId) - super(frame, options) + super(frame, options) @series_type = LineSeries @view3D = View3D.new({:perspective=>30}.merge(options)) end @@ -85,6 +85,31 @@ module Axlsx @gapDepth=(v) end + def to_xml_string(str = '') + super do |str| + str << '<line3DChart>' + str << '<grouping val="' << grouping.to_s << '"/>' + str << '<varyColors val="1"/>' + @series.each { |ser| ser.to_xml_str(str) } + str << '<dLbls>' + str << '<showLegendKey val="0"/>' + str << '<showVal val="0"/>' + str << '<showCatName val="0"/>' + str << '<showSerName val="0"/>' + str << '<showPercent val="0"/>' + str << '<showBubbleSize val="0"/>' + str << '</dLbls>' + str << '<gapDepth val="' << @gapDepth.to_s << '"/>' unless @gapDepth.nil? + str << '<axId val="' << @catAxId.to_s << '"/>' + str << '<axId val="' << @valAxId.to_s << '"/>' + str << '<axId val="' << @serAxId.to_s << '"/>' + str << '</line3DChart>' + @catAxis.to_xml_str str + @valAxis.to_xml_str str + @serAxis.to_xml_str str + end + end + # Serializes the bar chart # @return [String] def to_xml @@ -99,7 +124,7 @@ module Axlsx xml.showCatName :val=>0 xml.showSerName :val=>0 xml.showPercent :val=>0 - xml.showBubbleSize :val=>0 + xml.showBubbleSize :val=>0 } xml.gapDepth :val=>@gapDepth unless @gapDepth.nil? xml.axId :val=>@catAxId @@ -110,6 +135,6 @@ module Axlsx @valAxis.to_xml(xml) @serAxis.to_xml(xml) end - end - end + end + end end |
