Sha256: 9e86b7897e134f593a6fcf14a9ed8a004c24ca60b275083f4d6f2e2d341d6418

Contents?: true

Size: 1 KB

Versions: 8

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

require_relative './xlsx-func-testcase'

class TestChartTitle < XlsxWriterTestCase
  DATA = [
    [1,  2,  3],
    [2,  4,  6],
    [3,  6,  9],
    [4,  8, 12],
    [5, 10, 15]
  ]

  test 'chart_title01' do |wb|
    wb.add_worksheet do |ws|
      DATA.each { |row| ws.add_row row }

      wb.add_chart(XlsxWriter::Workbook::Chart::COLUMN) do |chart|
        chart.axis_id_1 = 46_165_376
        chart.axis_id_2 = 54_462_720

        series = chart.add_series('=Sheet1!$A$1:$A$5')
        series.name = 'Foo'
        chart.title = nil

        ws.insert_chart 'E9', chart
      end
    end
  end

  test 'chart_title02' do |wb|
    wb.add_worksheet do |ws|
      DATA.each { |row| ws.add_row row }

      wb.add_chart(XlsxWriter::Workbook::Chart::COLUMN) do |chart|
        chart.axis_id_1 = 73_655_040
        chart.axis_id_2 = 73_656_576

        series = chart.add_series('=Sheet1!$A$1:$A$5')
        chart.title = 'Title!'

        ws.insert_chart 'E9', chart
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
xlsxwriter-0.2.1.pre.2 test/test-chart-title.rb
xlsxwriter-0.2.1.pre test/test-chart-title.rb
xlsxwriter-0.2.0 test/test-chart-title.rb
xlsxwriter-0.2.0.pre.2 test/test-chart-title.rb
xlsxwriter-0.2.0.pre test/test-chart-title.rb
xlsxwriter-0.1.2.pre test/test-chart-title.rb
xlsxwriter-0.1.1 test/test-chart-title.rb
xlsxwriter-0.1.0 test/test-chart-title.rb