Skip to content

Commit

Permalink
cond format: add initial data bar style conditional format
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcnamara committed Nov 14, 2023
1 parent 602cc69 commit dc2e3a4
Show file tree
Hide file tree
Showing 6 changed files with 1,677 additions and 141 deletions.
8 changes: 3 additions & 5 deletions examples/doc_conditional_format_2color_set_minimum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
//! Example of adding 2 color scale type conditional formatting to a worksheet
//! with user defined minimum and maximum values.
use rust_xlsxwriter::{
ConditionalFormat2ColorScale, ConditionalFormatScaleType, Workbook, XlsxError,
};
use rust_xlsxwriter::{ConditionalFormat2ColorScale, ConditionalFormatType, Workbook, XlsxError};

fn main() -> Result<(), XlsxError> {
// Create a new Excel file object.
Expand All @@ -29,8 +27,8 @@ fn main() -> Result<(), XlsxError> {
// defined range. Values <= 3 will be shown with the minimum color while
// values >= 7 will be shown with the maximum color.
let conditional_format = ConditionalFormat2ColorScale::new()
.set_minimum(ConditionalFormatScaleType::Number, 3)
.set_maximum(ConditionalFormatScaleType::Number, 7);
.set_minimum(ConditionalFormatType::Number, 3)
.set_maximum(ConditionalFormatType::Number, 7);

worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?;

Expand Down
8 changes: 3 additions & 5 deletions examples/doc_conditional_format_3color_set_minimum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
//! Example of adding 3 color scale type conditional formatting to a worksheet
//! with user defined minimum and maximum values.
use rust_xlsxwriter::{
ConditionalFormat3ColorScale, ConditionalFormatScaleType, Workbook, XlsxError,
};
use rust_xlsxwriter::{ConditionalFormat3ColorScale, ConditionalFormatType, Workbook, XlsxError};

fn main() -> Result<(), XlsxError> {
// Create a new Excel file object.
Expand All @@ -29,8 +27,8 @@ fn main() -> Result<(), XlsxError> {
// defined range. Values <= 3 will be shown with the minimum color while
// values >= 7 will be shown with the maximum color.
let conditional_format = ConditionalFormat3ColorScale::new()
.set_minimum(ConditionalFormatScaleType::Number, 3)
.set_maximum(ConditionalFormatScaleType::Number, 7);
.set_minimum(ConditionalFormatType::Number, 3)
.set_maximum(ConditionalFormatType::Number, 7);

worksheet.add_conditional_format(2, 3, 11, 3, &conditional_format)?;

Expand Down
Loading

0 comments on commit dc2e3a4

Please sign in to comment.