Sha256: 5a3267886c02d4e53e130b1e74737db2c8c29ac4ff5511641a3dd4b67dff8dc7

Contents?: true

Size: 1.09 KB

Versions: 32

Compression:

Stored size: 1.09 KB

Contents

# -*- coding: utf-8 -*-
require 'helper'

class TestRegressionChartPoints03 < Test::Unit::TestCase
  def setup
    setup_dir_var
  end

  def teardown
    File.delete(@xlsx) if File.exist?(@xlsx)
  end

  def test_chart_points03
    @xlsx = 'chart_points03.xlsx'
    workbook  = WriteXLSX.new(@xlsx)
    worksheet = workbook.add_worksheet
    chart     = workbook.add_chart(:type => 'pie', :embedded => 1)

    workbook.set_custom_color(40, 0xCC, 0x00, 0x00)
    workbook.set_custom_color(41, 0x99, 0x00, 0x00)

    data = [
            [2, 5, 4]
           ]

    worksheet.write('A1', data)

    chart.add_series(
                     :values => '=Sheet1!$A$1:$A$3',
                     :points => [
                                 { :fill => { :color => '#FF0000' } },
                                 { :fill => { :color => '#CC0000' } },
                                 { :fill => { :color => '#990000' } }
                                ]
                     )

    worksheet.insert_chart('E9', chart)

    workbook.close
    compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
write_xlsx-0.73.0 test/regression/test_chart_points03.rb
write_xlsx-0.72.3.beta1 test/regression/test_chart_points03.rb
write_xlsx-0.72.2 test/regression/test_chart_points03.rb
write_xlsx-0.72.1 test/regression/test_chart_points03.rb
write_xlsx-0.72.0 test/regression/test_chart_points03.rb
write_xlsx-0.71.0 test/regression/test_chart_points03.rb
write_xlsx-0.70.0 test/regression/test_chart_points03.rb
write_xlsx-0.69.0 test/regression/test_chart_points03.rb
write_xlsx-0.65.1 test/regression/test_chart_points03.rb
write_xlsx-0.65.0 test/regression/test_chart_points03.rb
write_xlsx-0.64.1 test/regression/test_chart_points03.rb
write_xlsx-0.64.0 test/regression/test_chart_points03.rb