lib/axlsx/drawing/graphic_frame.rb in axlsx-1.3.4 vs lib/axlsx/drawing/graphic_frame.rb in axlsx-1.3.5
- old
+ new
@@ -22,11 +22,16 @@
@chart = chart_type.new(self, options)
end
# The relationship id for this graphic
# @return [String]
+ #
+ # NOTE: Discontinued. This should not be part of GraphicFrame.
+ # The drawing object maintains relationships and needs to be queried to determine the relationship id of any given graphic data child object.
+ #
def rId
+ warn('axlsx::DEPRECIATED: GraphicFrame#rId has been depreciated. relationship id is determed by the drawing object')
"rId#{@anchor.index+1}"
end
# Serializes the object
# @param [String] str
@@ -42,10 +47,10 @@
str << '<a:off x="0" y="0"/>'
str << '<a:ext cx="0" cy="0"/>'
str << '</xdr:xfrm>'
str << '<a:graphic>'
str << '<a:graphicData uri="' << XML_NS_C << '">'
- str << '<c:chart xmlns:c="' << XML_NS_C << '" xmlns:r="' << XML_NS_R << '" r:id="' << rId.to_s << '"/>'
+ str << '<c:chart xmlns:c="' << XML_NS_C << '" xmlns:r="' << XML_NS_R << '" r:id="rId' << (@anchor.drawing.index_of(@chart)+1).to_s << '"/>'
str << '</a:graphicData>'
str << '</a:graphic>'
str << '</xdr:graphicFrame>'
end