def prepare_chart(index, chart_id, drawing_id) # :nodoc:
      drawing_type = 1

      row, col, chart, x_offset, y_offset, x_scale, y_scale  = @charts[index]
      chart.id = chart_id - 1
      x_scale ||= 0
      y_scale ||= 0

      # Use user specified dimensions, if any.
      width  = chart.width  if ptrue?(chart.width)
      height = chart.height if ptrue?(chart.height)

      width  = (0.5 + (width  * x_scale)).to_i
      height = (0.5 + (height * y_scale)).to_i

      dimensions = position_object_emus(col, row, x_offset, y_offset, width, height)

      # Set the chart name for the embedded object if it has been specified.
      name = chart.name

      # Create a Drawing object to use with worksheet unless one already exists.
      if !drawing?
        drawing = Drawing.new
        drawing.add_drawing_object(drawing_type, dimensions, 0, 0, name)
        drawing.embedded = 1

        @drawing = drawing

        @external_drawing_links << ['/drawing', "../drawings/drawing#{drawing_id}.xml" ]
      else
        @drawing.add_drawing_object(drawing_type, dimensions, 0, 0, name)
      end
      @drawing_links << ['/chart', "../charts/chart#{chart_id}.xml"]
    end
def prepare_chart(index, chart_id, drawing_id) # :nodoc:
      drawing_type = 1

      row, col, chart, x_offset, y_offset, x_scale, y_scale  = @charts[index]
      chart.id = chart_id - 1
      x_scale ||= 0
      y_scale ||= 0

      # Use user specified dimensions, if any.
      width  = chart.width  if ptrue?(chart.width)
      height = chart.height if ptrue?(chart.height)

      width  = (0.5 + (width  * x_scale)).to_i
      height = (0.5 + (height * y_scale)).to_i

      dimensions = position_object_emus(col, row, x_offset, y_offset, width, height)

      # Set the chart name for the embedded object if it has been specified.
      name = chart.name

      # Create a Drawing object to use with worksheet unless one already exists.
      if !drawing?
        drawing = Drawing.new
        drawing.add_drawing_object(drawing_type, dimensions, 0, 0, name)
        drawing.embedded = 1

        @drawing = drawing

        @external_drawing_links << ['/drawing', "../drawings/drawing#{drawing_id}.xml" ]
      else
        @drawing.add_drawing_object(drawing_type, dimensions, 0, 0, name)
      end
      @drawing_links << ['/chart', "../charts/chart#{chart_id}.xml"]
    end
Set up chart/drawings.