# encoding: UTF-8 module Axlsx # A graphic frame defines a container for a chart object # @note The recommended way to manage charts is Worksheet#add_chart # @see Worksheet#add_chart class GraphicFrame # A reference to the chart object associated with this frame # @return [Chart] attr_reader :chart # A anchor that holds this frame # @return [TwoCellAnchor] attr_reader :anchor # Creates a new GraphicFrame object # @param [TwoCellAnchor] anchor # @param [Class] chart_type def initialize(anchor, chart_type, options) DataTypeValidator.validate "Drawing.chart_type", Chart, chart_type @anchor = anchor @chart = chart_type.new(self, options) end # The relationship id for this graphic frame. # @return [String] def rId @anchor.drawing.relationships.for(chart).Id end # Serializes the object # @param [String] str # @return [String] def to_xml_string(str = '') # macro attribute should be optional! str << '' str << '' str << ('') str << '' str << '' str << '' str << '' str << '' str << '' str << '' str << ('') str << ('') str << '' str << '' str << '' end end end