def write_plot_area   # :nodoc:
      second_chart = @combined
      @writer.tag_elements('c:plotArea') do
        # Write the c:layout element.
        write_layout(@plotarea.layout, 'plot')
        # Write the subclass chart type elements for primary and secondary axes.
        write_chart_type(:primary_axes => 1)
        write_chart_type(:primary_axes => 0)

        # Configure a combined chart if present.
        if second_chart

          # Secondary axis has unique id otherwise use same as primary.
          if second_chart.is_secondary?
            second_chart.id = 1000 + @id
          else
            second_chart.id = @id
          end

          # Share the same writer for writing.
          second_chart.writer = @writer

          # Share series index with primary chart.
          second_chart.series_index = @series_index

          # Write the subclass chart type elements for combined chart.
          second_chart.write_chart_type(:primary_axes => 1)
          second_chart.write_chart_type(:primary_axes => 0)
        end

        # Write the category and value elements for the primary axes.
        params = {
          :x_axis   => @x_axis,
          :y_axis   => @y_axis,
          :axis_ids => @axis_ids
        }

        if @date_category
          write_date_axis(params)
        else
          write_cat_axis(params)
        end

        write_val_axis(@x_axis, @y_axis, @axis_ids)

        # Write the category and value elements for the secondary axes.
        params = {
          :x_axis   => @x2_axis,
          :y_axis   => @y2_axis,
          :axis_ids => @axis2_ids
        }

        write_val_axis(@x2_axis, @y2_axis, @axis2_ids)

        # Write the secondary axis for the secondary chart.
        if second_chart && second_chart.is_secondary?

          params = {
            :x_axis   => second_chart.x2_axis,
            :y_axis   => second_chart.y2_axis,
            :axis_ids => second_chart.axis2_ids
          }

          second_chart.write_val_axis(
            second_chart.x2_axis,
            second_chart.y2_axis,
            second_chart.axis2_ids
          )
        end

        if @date_category
          write_date_axis(params)
        else
          write_cat_axis(params)
        end

        # Write the c:dTable element.
        write_d_table

        # Write the c:spPr element for the plotarea formatting.
        write_sp_pr(@plotarea)
      end
    end
def write_plot_area   # :nodoc:
      second_chart = @combined
      @writer.tag_elements('c:plotArea') do
        # Write the c:layout element.
        write_layout(@plotarea.layout, 'plot')
        # Write the subclass chart type elements for primary and secondary axes.
        write_chart_type(:primary_axes => 1)
        write_chart_type(:primary_axes => 0)

        # Configure a combined chart if present.
        if second_chart

          # Secondary axis has unique id otherwise use same as primary.
          if second_chart.is_secondary?
            second_chart.id = 1000 + @id
          else
            second_chart.id = @id
          end

          # Share the same writer for writing.
          second_chart.writer = @writer

          # Share series index with primary chart.
          second_chart.series_index = @series_index

          # Write the subclass chart type elements for combined chart.
          second_chart.write_chart_type(:primary_axes => 1)
          second_chart.write_chart_type(:primary_axes => 0)
        end

        # Write the category and value elements for the primary axes.
        params = {
          :x_axis   => @x_axis,
          :y_axis   => @y_axis,
          :axis_ids => @axis_ids
        }

        if @date_category
          write_date_axis(params)
        else
          write_cat_axis(params)
        end

        write_val_axis(@x_axis, @y_axis, @axis_ids)

        # Write the category and value elements for the secondary axes.
        params = {
          :x_axis   => @x2_axis,
          :y_axis   => @y2_axis,
          :axis_ids => @axis2_ids
        }

        write_val_axis(@x2_axis, @y2_axis, @axis2_ids)

        # Write the secondary axis for the secondary chart.
        if second_chart && second_chart.is_secondary?

          params = {
            :x_axis   => second_chart.x2_axis,
            :y_axis   => second_chart.y2_axis,
            :axis_ids => second_chart.axis2_ids
          }

          second_chart.write_val_axis(
            second_chart.x2_axis,
            second_chart.y2_axis,
            second_chart.axis2_ids
          )
        end

        if @date_category
          write_date_axis(params)
        else
          write_cat_axis(params)
        end

        # Write the c:dTable element.
        write_d_table

        # Write the c:spPr element for the plotarea formatting.
        write_sp_pr(@plotarea)
      end
    end
Write the <c:plotArea> element.