Hi,
I have recently upgraded from Aspose.Cells 17.7 to 18.8, some of my charts appear differently now.
It appears to be related to major and minor gridlines of the value and category axis.
I have attached 2 sample workbooks (177.xlsx -rendered in 17.7 and 188.xlsx - rendered in 18.8)
Sample.zip (19.8 KB)
Are the reasons why I would such inconsistencies from the 2 versions? have the defaults changed?
Please let me know your thoughts.
Thanks!
Nick
@px_brass,
Thanks for your query.
Please share your sample console application (runnable) which is used to create these files. We may use this application here to reproduce this issue and provide our feedback.
Hi,
Here is a sample set of code. I have removed my license and the aspose.cells.dlls to reduce the size of the sample for uploading, so you will need to add it back.
I am trying to set the format of major and minor gridlines on the value and category axis. If you use aspose.cells 17.7 and aspose.cells 18.8 you will notice different results.
Both seem to not work as expected.
I set the grid lines visibility to false and formattingType to none and they still display in both 17.7 and 18.8.
In 17.7 it seems to at least pick up on the formatting I have requested.
In 18.8 in seems to ignore the settings altogether and just apply automatic formatting.
Please let me know if you have further questions.
Thanks.
Nick
TestAsposeCells.zip (962.1 KB)
@px_brass,
Thanks for providing the sample code. There seems to be little typo error which needs to be clarified. The code block starting from the following line exists twice.
gridLines = chart.CategoryAxis.MajorGridLines
Please correct this error and send us code again. Also please send us expected output file which is created using Excel (not Aspose.Cells) for our reference. We will use it for comparison with the output file generated by Aspose.Cells.
We have tested the issue with latest version Aspose.Cells for .NET 18.9.3. You may please use following version for your testing.
Aspose.Cells for .NET 18.9.3
Hi,
I uploaded the sample once more. I have removed my license and the aspose.cells.dlls to reduce the size of the sample for uploading, so you will need to add it back again. I updated the code, and it did not change the result.
Here is the expected excel file (the value axis has red applied to major axis and no gridlines applied to all other major and minor axis):
ExpectedResult.zip (9.7 KB)
The issue we appear to be having is the settings applied to the major and minor gridlines are not retained once you save the excel workbook (always set to automatic). Hopefully this sample is enough to see the issue, but it should also be easy to reproduce on your end, unless I am mistaken.
Please let me know if you have further questions.
Thanks.
Nick
TestAsposeCells.zip (5.7 MB)
@px_brass,
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.
This issue has been logged as
CELLSNET-46372 - Major and Minor gridline values not retained while saving a workbook as XLSX
Thank you for the update!
@px_brass,
Please try gridLines.FormattingType = ChartLineFormattingType.None
, it will work fine:
e.g
Sample code:
...........
Dim gridLines as Line
gridLines = chart.CategoryAxis.MajorGridLines
gridLines.BeginArrowWidth = Aspose.Cells.Charts.ChartLineFormattingType.Solid
gridLines.BeginType = MsoArrowheadStyle.None
gridLines.CapType = LineCapType.Flat
gridLines.Color = System.Drawing.Color.Red
gridLines.CompoundType = MsoLineStyle.Single
gridLines.DashType = MsoLineDashStyle.Solid
gridLines.EndArrowLength = MsoArrowheadLength.Medium
gridLines.EndArrowWidth = MsoArrowheadLength.Medium
gridLines.EndType = MsoArrowheadStyle.None
gridLines.FormattingType = MsoArrowheadStyle.None
gridLines.IsAuto = false
gridLines.IsVisible = false
gridLines.JoinType = LineJoinType.Round
gridLines.Style = LineType.Solid
gridLines.Transparency = 0
gridLines.Weight = WeightType.HairLine
gridLines.WeightPt = 0
gridLines.WeightPx = 0
gridLines.FormattingType = ChartLineFormattingType.None
gridLines = chart.CategoryAxis.MinorGridLines
gridLines.BeginArrowWidth = Aspose.Cells.Charts.ChartLineFormattingType.Solid
gridLines.BeginType = MsoArrowheadStyle.None
gridLines.CapType = LineCapType.Flat
gridLines.Color = System.Drawing.Color.Red
gridLines.CompoundType = MsoLineStyle.Single
gridLines.DashType = MsoLineDashStyle.Solid
gridLines.EndArrowLength = MsoArrowheadLength.Medium
gridLines.EndArrowWidth = MsoArrowheadLength.Medium
gridLines.EndType = MsoArrowheadStyle.None
gridLines.FormattingType = MsoArrowheadStyle.None
gridLines.IsAuto = false
gridLines.IsVisible = false
gridLines.JoinType = LineJoinType.Round
gridLines.Style = LineType.Solid
gridLines.Transparency = 0
gridLines.Weight = WeightType.HairLine
gridLines.WeightPt = 0
gridLines.WeightPx = 0
gridLines.FormattingType = ChartLineFormattingType.None
gridLines = chart.ValueAxis.MinorGridLines
gridLines.BeginArrowWidth = Aspose.Cells.Charts.ChartLineFormattingType.Solid
gridLines.BeginType = MsoArrowheadStyle.None
gridLines.CapType = LineCapType.Flat
gridLines.Color = System.Drawing.Color.Red
gridLines.CompoundType = MsoLineStyle.Single
gridLines.DashType = MsoLineDashStyle.Solid
gridLines.EndArrowLength = MsoArrowheadLength.Medium
gridLines.EndArrowWidth = MsoArrowheadLength.Medium
gridLines.EndType = MsoArrowheadStyle.None
gridLines.FormattingType = MsoArrowheadStyle.None
gridLines.IsAuto = false
gridLines.IsVisible = false
gridLines.JoinType = LineJoinType.Round
gridLines.Style = LineType.Solid
gridLines.Transparency = 0
gridLines.Weight = WeightType.HairLine
gridLines.WeightPt = 0
gridLines.WeightPx = 0
gridLines.FormattingType = ChartLineFormattingType.None
gridLines = chart.ValueAxis.MajorGridLines
gridLines.BeginArrowWidth = Aspose.Cells.Charts.ChartLineFormattingType.Solid
gridLines.BeginType = MsoArrowheadStyle.None
gridLines.CapType = LineCapType.Flat
gridLines.Color = System.Drawing.Color.Red
gridLines.CompoundType = MsoLineStyle.Single
gridLines.DashType = MsoLineDashStyle.Solid
gridLines.EndArrowLength = MsoArrowheadLength.Medium
gridLines.EndArrowWidth = MsoArrowheadLength.Medium
gridLines.EndType = MsoArrowheadStyle.None
gridLines.FormattingType = MsoArrowheadStyle.None
gridLines.IsAuto = false
gridLines.IsVisible = false
gridLines.JoinType = LineJoinType.Round
gridLines.Style = LineType.Solid
gridLines.Transparency = 0
gridLines.Weight = WeightType.HairLine
gridLines.WeightPt = 0
gridLines.WeightPx = 0
gridLines.FormattingType = ChartLineFormattingType.None
Let us know your feedback.
Hi,
Sorry for there was a typo in sample I sent. Yes, none seems to work in version 18.9.3 now thanks! But I am still having an issue setting a grid line to Solid in 18.9.3.
In the code below I am trying to set the MajorGridLines of the value axis and category axis to a solid line that is custom colour (Red) and it seems to appear as automatic. I added the FormattingType before and after I set all the properties and it did not help. The same code works in version 17.7.
Dim gridLines as Line
gridLines = chart.CategoryAxis.MajorGridLines
gridLines.FormattingType = ChartLineFormattingType.Solid
gridLines.BeginArrowWidth = MsoArrowheadWidth.Medium
gridLines.BeginType = MsoArrowheadStyle.None
gridLines.CapType = LineCapType.Flat
gridLines.Color = System.Drawing.Color.Red
gridLines.CompoundType = MsoLineStyle.Single
gridLines.DashType = MsoLineDashStyle.Solid
gridLines.EndArrowLength = MsoArrowheadLength.Medium
gridLines.EndArrowWidth = MsoArrowheadLength.Medium
gridLines.EndType = MsoArrowheadStyle.None
gridLines.IsAuto = false
gridLines.IsVisible = false
gridLines.JoinType = LineJoinType.Round
gridLines.Style = LineType.Solid
gridLines.Transparency = 0
gridLines.Weight = WeightType.HairLine
gridLines.WeightPt =1
'gridLines.WeightPx = 0
gridLines.FormattingType = ChartLineFormattingType.Solid
gridLines = chart.CategoryAxis.MinorGridLines
gridLines.BeginArrowWidth = MsoArrowheadWidth.Medium
gridLines.BeginType = MsoArrowheadStyle.None
gridLines.CapType = LineCapType.Flat
gridLines.Color = System.Drawing.Color.Red
gridLines.CompoundType = MsoLineStyle.Single
gridLines.DashType = MsoLineDashStyle.Solid
gridLines.EndArrowLength = MsoArrowheadLength.Medium
gridLines.EndArrowWidth = MsoArrowheadLength.Medium
gridLines.EndType = MsoArrowheadStyle.None
gridLines.FormattingType = ChartLineFormattingType.None
gridLines.IsAuto = false
gridLines.IsVisible = false
gridLines.JoinType = LineJoinType.Round
gridLines.Style = LineType.Solid
gridLines.Transparency = 0
gridLines.Weight = WeightType.HairLine
gridLines.WeightPt = 0
gridLines.WeightPx = 0
gridLines.FormattingType = ChartLineFormattingType.None
gridLines = chart.ValueAxis.MajorGridLines
gridLines.FormattingType = ChartLineFormattingType.Solid
gridLines.BeginArrowWidth = MsoArrowheadWidth.Medium
gridLines.BeginType = MsoArrowheadStyle.None
gridLines.CapType = LineCapType.Flat
gridLines.Color = System.Drawing.Color.Red
gridLines.CompoundType = MsoLineStyle.Single
gridLines.DashType = MsoLineDashStyle.Solid
gridLines.EndArrowLength = MsoArrowheadLength.Medium
gridLines.EndArrowWidth = MsoArrowheadLength.Medium
gridLines.EndType = MsoArrowheadStyle.None
gridLines.IsAuto = false
gridLines.IsVisible = false
gridLines.JoinType = LineJoinType.Round
gridLines.Style = LineType.Solid
gridLines.Transparency = 0
gridLines.Weight = WeightType.HairLine
gridLines.WeightPt = 1
'gridLines.WeightPx = 0
gridLines.FormattingType = ChartLineFormattingType.Solid
gridLines = chart.ValueAxis.MinorGridLines
gridLines.BeginArrowWidth = MsoArrowheadWidth.Medium
gridLines.BeginType = MsoArrowheadStyle.None
gridLines.CapType = LineCapType.Flat
gridLines.Color = System.Drawing.Color.Red
gridLines.CompoundType = MsoLineStyle.Single
gridLines.DashType = MsoLineDashStyle.Solid
gridLines.EndArrowLength = MsoArrowheadLength.Medium
gridLines.EndArrowWidth = MsoArrowheadLength.Medium
gridLines.EndType = MsoArrowheadStyle.None
gridLines.FormattingType = ChartLineFormattingType.None
gridLines.IsAuto = false
gridLines.IsVisible = false
gridLines.JoinType = LineJoinType.Round
gridLines.Style = LineType.Solid
gridLines.Transparency = 0
gridLines.Weight = WeightType.HairLine
gridLines.WeightPt = 0
gridLines.WeightPx = 0
gridLines.FormattingType = ChartLineFormattingType.None
Let me know if I made any mistakes.
Thanks.
Nick
@px_brass,
I have worked with the code shared by you but the issue is not reproduced with latest version of Aspose.Cells. Please upgrade to Aspose.Cells for .NET 18.10 and let us know your feedback.