You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mats Alm edited this page Oct 26, 2023
·
5 revisions
Here is a Conditional Formatting example where we add a ThreeColorScale rule. Let's start with how the result will look like:
Here is how this rule will look like when edited in Excel:
And here is the code to achieve it with EPPlus:
// Add TwoColorScale conditional formatting to visualize temperatures// ColorTranslator is a utility from System.Drawing.Primitives.varcfRule=sheet.ConditionalFormatting.AddThreeColorScale(sheet.Cells["B2:G11"]);cfRule.LowValue.Color=ColorTranslator.FromHtml("#FF63BE7B");cfRule.MiddleValue.Color=ColorTranslator.FromHtml("#FFFFEB84");cfRule.MiddleValue.Type=eExcelConditionalFormattingValueObjectType.Percentile;cfRule.MiddleValue.Value=50;cfRule.HighValue.Color=ColorTranslator.FromHtml("#FFF8696B");