def store_charts   #:nodoc:
    # Skip this if there aren't any charts.
    return if charts_size == 0

    record = 0x00EC           # Record identifier

    charts = @charts.array

    charts.each_index do |i|
      data = ''
      if i == 0 && images_size == 0
        dg_length    = 192 + 120 * (charts_size - 1) + 96 * filter_count + 128 * comments_size
        spgr_length  = dg_length - 24

        # Write the parent MSODRAWIING record.
        data += store_parent_mso_record(dg_length, spgr_length, @object_ids.spid)
        @object_ids.spid += 1
      end
      data += store_mso_sp_container_sp(@object_ids.spid)
      data += store_mso_opt_chart_client_anchor_client_data(*charts[i].vertices)
      length = data.bytesize
      header = [record, length].pack("vv")
      append(header, data)

      store_obj_chart(images_size + i + 1)
      store_chart_binary(charts[i].chart)
      @object_ids.spid += 1
    end

    # Simulate the EXTERNSHEET link between the chart and data using a formula
    # such as '=Sheet1!A1'.
    # TODO. Won't work for external data refs. Also should use a more direct
    #       method.
    #
    store_formula("='#{@name}'!A1")
  end
def store_charts   #:nodoc:
    # Skip this if there aren't any charts.
    return if charts_size == 0

    record = 0x00EC           # Record identifier

    charts = @charts.array

    charts.each_index do |i|
      data = ''
      if i == 0 && images_size == 0
        dg_length    = 192 + 120 * (charts_size - 1) + 96 * filter_count + 128 * comments_size
        spgr_length  = dg_length - 24

        # Write the parent MSODRAWIING record.
        data += store_parent_mso_record(dg_length, spgr_length, @object_ids.spid)
        @object_ids.spid += 1
      end
      data += store_mso_sp_container_sp(@object_ids.spid)
      data += store_mso_opt_chart_client_anchor_client_data(*charts[i].vertices)
      length = data.bytesize
      header = [record, length].pack("vv")
      append(header, data)

      store_obj_chart(images_size + i + 1)
      store_chart_binary(charts[i].chart)
      @object_ids.spid += 1
    end

    # Simulate the EXTERNSHEET link between the chart and data using a formula
    # such as '=Sheet1!A1'.
    # TODO. Won't work for external data refs. Also should use a more direct
    #       method.
    #
    store_formula("='#{@name}'!A1")
  end
Store the collections of records that make up charts.