From a254ac9cd781bbad0121717374ce90fe124f29b9 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Fri, 9 Mar 2012 18:08:16 +0900 Subject: patch title serialization for graphic frame --- lib/axlsx/drawing/graphic_frame.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/axlsx/drawing/graphic_frame.rb b/lib/axlsx/drawing/graphic_frame.rb index 903ff1d6..178e0ea8 100644 --- a/lib/axlsx/drawing/graphic_frame.rb +++ b/lib/axlsx/drawing/graphic_frame.rb @@ -17,14 +17,14 @@ module Axlsx # @param [TwoCellAnchor] anchor # @param [Class] chart_type def initialize(anchor, chart_type, options) - DataTypeValidator.validate "Drawing.chart_type", Chart, chart_type + DataTypeValidator.validate "Drawing.chart_type", Chart, chart_type @anchor = anchor @chart = chart_type.new(self, options) end # The relationship id for this graphic # @return [String] - def rId + def rId "rId#{@anchor.index+1}" end @@ -32,10 +32,10 @@ module Axlsx # @param [Nokogiri::XML::Builder] xml The document builder instance this objects xml will be added to. # @return [String] def to_xml(xml) - xml.graphicFrame { + xml.graphicFrame { xml.nvGraphicFramePr { - xml.cNvPr :id=>2, :name=>chart.title - xml.cNvGraphicFramePr + xml.cNvPr :id=>2, :name=>chart.title.text + xml.cNvGraphicFramePr } xml.xfrm { xml[:a].off(:x=>0, :y=>0) @@ -47,7 +47,7 @@ module Axlsx } } } - + end end end -- cgit v1.2.3