Having a problem generating a set of data bars. A 'zero value' is generating a small positive bar to the right of the axis. I don't see this behavior natively in Excel. Is this a bug or am I doing something wrong?
Code is below, the resulting excel sheet is attached.
Using Aspose Cells 8.6.2, Visual Studio 2013, Excel 2013.
Thanks,
Jim
Dim book As New Aspose.Cells.Workbook
Dim sheet = book.Worksheets(0)
'Sample values.
Dim values As New List(Of Integer) From {-1, 0, 1, 2, 3}
'Populate the column with the values.
For i As Integer = 0 To values.Count - 1
sheet.Cells(i, 0).PutValue(values(i))
Next
'Set up data bar conditional formatting.
Dim index As Integer = sheet.ConditionalFormattings.Add()
Dim conds As FormatConditionCollection = sheet.ConditionalFormattings(index)
'Set the conditional format range.
Dim ca As CellArea = New CellArea()
ca.StartRow = 0
ca.EndRow = values.Count - 1
ca.StartColumn = 0
ca.EndColumn = 0
conds.AddArea(ca)
Dim idx As Integer = conds.AddCondition(FormatConditionType.DataBar)
Dim cond As FormatCondition = conds(idx)
cond.DataBar.BarFillType = DataBarFillType.Solid
cond.DataBar.AxisPosition = DataBarAxisPosition.Midpoint
'Make the column wider.
sheet.Cells.SetColumnWidth(0, 40)
'Save the results.
book.Save("c:\temp\test.xlsx", SaveFormat.Xlsx)