I need to display horizontal data bars in one of the columns, but for some reason data bar is displayed for the cell with Value = 0.
The code:
- Code: Select all
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].NumberValue = 1;
sheet.Range["A2"].NumberValue = 0;
sheet.Range["A3"].NumberValue = 3;
sheet.Range["A4"].NumberValue = 8;
sheet.Range["A5"].NumberValue = 5;
ConditionalFormatWrapper format = sheet.Range["A1:A5"].ConditionalFormats.AddCondition();
format.FormatType = ConditionalFormatType.DataBar;
workbook.SaveToFile("D:\\sample.xlsx", ExcelVersion.Version2010);
Here is what I have:
But when I set Data Bar using Excel tools directly, I have the following:
I.e. there is no horizontal data bar for A2 cell, as the value in it is 0.
Could you please let me know if it is possible to not show data bar for cells with 0 value using Spire.Xls library?
Thank you.