diff options
| author | Randy Morgan (@morgan_randy) <[email protected]> | 2014-03-07 20:05:26 +0900 |
|---|---|---|
| committer | Randy Morgan (@morgan_randy) <[email protected]> | 2014-03-07 20:05:26 +0900 |
| commit | a3a1b62d7751b7323c7ac0f23e75bb8409dffb9b (patch) | |
| tree | 126dab680fa81228b9f131c97dddc54df0109e28 | |
| parent | 7771d1b7103385718818883e332255cf7fc6d876 (diff) | |
| parent | 36abeade6fa2f9d7176d59191300c8ab0e68ef71 (diff) | |
| download | caxlsx-a3a1b62d7751b7323c7ac0f23e75bb8409dffb9b.tar.gz caxlsx-a3a1b62d7751b7323c7ac0f23e75bb8409dffb9b.zip | |
Merge pull request #299 from geruhl/patch-1
Fix conditional_formatting example file
| -rw-r--r-- | examples/conditional_formatting/example_conditional_formatting.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/conditional_formatting/example_conditional_formatting.rb b/examples/conditional_formatting/example_conditional_formatting.rb index f5823ab4..320ae9f1 100644 --- a/examples/conditional_formatting/example_conditional_formatting.rb +++ b/examples/conditional_formatting/example_conditional_formatting.rb @@ -11,8 +11,8 @@ percent = book.styles.add_style(:format_code => "0.00%", :border => Axlsx::STYLE money = book.styles.add_style(:format_code => '0,000', :border => Axlsx::STYLE_THIN_BORDER) # define the style for conditional formatting -profitable = book.styles.add_style( :fg_color => "FF428751", :type => :dxf ) -unprofitable = wb.styles.add_style( :fg_color => "FF0000", :type => :dxf ) +profitable = book.styles.add_style( :fg_color => "428751", :type => :dxf ) +unprofitable = book.styles.add_style( :fg_color => "FF0000", :type => :dxf ) book.add_worksheet(:name => "Cell Is") do |ws| @@ -28,7 +28,7 @@ book.add_worksheet(:name => "Cell Is") do |ws| # Apply conditional formatting to range B3:B100 in the worksheet ws.add_conditional_formatting("B3:B100", { :type => :cellIs, :operator => :greaterThan, :formula => "100000", :dxfId => profitable, :priority => 1 }) # Apply conditional using the between operator; NOTE: supply an array to :formula for between/notBetween - sheet.add_conditional_formatting("C3:C100", { :type => :cellIs, :operator => :between, :formula => ["0.00%","100.00%"], :dxfId => unprofitable, :priority => 1 }) + ws.add_conditional_formatting("C3:C100", { :type => :cellIs, :operator => :between, :formula => ["0.00%","100.00%"], :dxfId => unprofitable, :priority => 1 }) end book.add_worksheet(:name => "Color Scale") do |ws| |
