Sha256: 73bbe177b754a2f71fb30b4d56be95c782dc2de248a6fe6a1242a79bf85cdada

Contents?: true

Size: 1.35 KB

Versions: 10

Compression:

Stored size: 1.35 KB

Contents

# -*- coding: utf-8 -*-
###############################################################################
#
# Line - A class for writing Excel Line charts.
#
# Used in conjunction with Chart.
#
# See formatting note in Chart.
#
# Copyright 2000-2011, John McNamara, jmcnamara@cpan.org
# Convert to ruby by Hideo NAKAMURA, cxn03651@msj.biglobe.ne.jp
#

require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility'

module Writexlsx
  class Chart
    class Line < self
      include Writexlsx::Utility

      def initialize(subtype)
        super(subtype)
        @default_marker = {:type => 'none'}
      end

      #
      # Override the virtual superclass method with a chart specific method.
      #
      def write_chart_type(params)
        # Write the c:barChart element.
        write_line_chart(params)
      end

      #
      # Write the <c:lineChart> element.
      #
      def write_line_chart(params)
        series = axes_series(params)
        return if series.empty?

        @writer.tag_elements('c:lineChart') do
          # Write the c:grouping element.
          write_grouping('standard')
          # Write the series elements.
          series.each {|s| write_series(s)}

          # Write the c:marker element.
          write_marker_value

          # Write the c:axId elements
          write_axis_ids(params)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
write_xlsx-0.62.0 lib/write_xlsx/chart/line.rb
write_xlsx-0.61.0 lib/write_xlsx/chart/line.rb
write_xlsx-0.60.0 lib/write_xlsx/chart/line.rb
write_xlsx-0.59.0 lib/write_xlsx/chart/line.rb
write_xlsx-0.58.0 lib/write_xlsx/chart/line.rb
write_xlsx-0.57.0 lib/write_xlsx/chart/line.rb
write_xlsx-0.56.0 lib/write_xlsx/chart/line.rb
write_xlsx-0.55.0 lib/write_xlsx/chart/line.rb
write_xlsx-0.54.0 lib/write_xlsx/chart/line.rb
write_xlsx-0.51.0 lib/write_xlsx/chart/line.rb