def close  # :nodoc:
    # Ignore any data that has been written so far since it is probably
    # from unwanted Worksheet method calls.
    @data = ''

    # TODO. Check for charts without a series?

    # Store the chart BOF.
    store_bof(0x0020)

    # Store the page header
    store_header

    # Store the page footer
    store_footer

    # Store the page horizontal centering
    store_hcenter

    # Store the page vertical centering
    store_vcenter

    # Store the left margin
    store_margin_left

    # Store the right margin
    store_margin_right

    # Store the top margin
    store_margin_top

    # Store the bottom margin
    store_margin_bottom

    # Store the page setup
    store_setup

    # Store the sheet password
    store_password

    # Start of Chart specific records.

    # Store the FBI font records.
    store_fbi(*@config[:font_numbers])
    store_fbi(*@config[:font_series])
    store_fbi(*@config[:font_title])
    store_fbi(*@config[:font_axes])

    # Ignore UNITS record.

    # Store the Chart sub-stream.
    store_chart_stream

    # Append the sheet dimensions
    store_dimensions

    # TODO add SINDEX and NUMBER records.

    store_window2 unless @embedded

    store_eof
  end
def close  # :nodoc:
    # Ignore any data that has been written so far since it is probably
    # from unwanted Worksheet method calls.
    @data = ''

    # TODO. Check for charts without a series?

    # Store the chart BOF.
    store_bof(0x0020)

    # Store the page header
    store_header

    # Store the page footer
    store_footer

    # Store the page horizontal centering
    store_hcenter

    # Store the page vertical centering
    store_vcenter

    # Store the left margin
    store_margin_left

    # Store the right margin
    store_margin_right

    # Store the top margin
    store_margin_top

    # Store the bottom margin
    store_margin_bottom

    # Store the page setup
    store_setup

    # Store the sheet password
    store_password

    # Start of Chart specific records.

    # Store the FBI font records.
    store_fbi(*@config[:font_numbers])
    store_fbi(*@config[:font_series])
    store_fbi(*@config[:font_title])
    store_fbi(*@config[:font_axes])

    # Ignore UNITS record.

    # Store the Chart sub-stream.
    store_chart_stream

    # Append the sheet dimensions
    store_dimensions

    # TODO add SINDEX and NUMBER records.

    store_window2 unless @embedded

    store_eof
  end
Create and store the Chart data structures.