Hello,
I tried to setup custom icons for icon set conditional formatting but the icons are not changed after saving the XLSX file.
Also I didn’t find any information or examples about how to setup custom icon set, so I had to spend a lot of time to understand how it can be configured. It would be nice to have some documentation with examples regarding that.
Am I doing something wrong?
Code:
// Apply 'Icon Set' conditional formatting to 'Years of Service' column.
IconSetCondition iconSetCondition = worksheet.ConditionalFormatting.AddIconSet("C2:C" + (rowCount + 1));
iconSetCondition.IconStyle = SpreadsheetIconStyle.FourTrafficLights;
iconSetCondition.Icons[3].Icon = new SpreadsheetIcon(SpreadsheetIconStyle.ThreeSymbolsCircled, id: 0);
iconSetCondition.Icons[3].Value = ConditionalValue.FromNumber(30);
iconSetCondition.Icons[2].Icon = new SpreadsheetIcon(SpreadsheetIconStyle.ThreeSymbolsCircled, id: 1);
iconSetCondition.Icons[2].Value = ConditionalValue.FromNumber(20);
iconSetCondition.Icons[1].Icon = new SpreadsheetIcon(SpreadsheetIconStyle.ThreeSymbolsCircled, id: 2);
iconSetCondition.Icons[1].Value = ConditionalValue.FromNumber(10);
iconSetCondition.Icons[0].Icon = new SpreadsheetIcon(SpreadsheetIconStyle.FourRedToBlack, id: 1);
iconSetCondition.Icons[0].Value = ConditionalValue.FromNumber(0);