We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

chart.CategoryAxis.TickLabels.RotationAngle does not work in XLSLX after Worksheet.Copy. Works in XLS

Windows XP.
Excel 2007.
.NET 3.5

When using workbook.copy and then saving a file as .xlsx the rotation angle of ticklabels is gone. Also, chart legend is slightly off. See image.

bad_formatting does not have diagonal ticklabels, it is the result of copy and save as .xlsx
good_formatting is .xls and is ok.
pre_merge is before the copy and is ok.

Workbook wb = new Workbook();
Worksheet sheet = wb.Worksheets[0];
Cells cells = sheet.Cells;

cells[0, 0].Value = “one”;
cells[1, 0].Value = “two”;
cells[2, 0].Value = “three”;

cells[0, 1].Value = 10;
cells[1, 1].Value = 20;
cells[2, 1].Value = 30;

cells[0, 2].Value = 30;
cells[1, 2].Value = 20;
cells[2, 2].Value = 10;

int chartIndex = sheet.Charts.Add(ChartType.Column, 0, 0, 10, 10);
Chart chart = sheet.Charts[chartIndex];

int sIndex = chart.NSeries.Add(“B1:B3”, true);
Series series1 = chart.NSeries[sIndex];
int sIndex2 = chart.NSeries.Add(“C1:C3”, true);
Series series2 = chart.NSeries[sIndex2];

chart.Title.Text = “This Is The Chart Title”;
//chart.Title.TextHorizontalAlignment = TextAlignmentType.Left;
//chart.Title.Width = 100;
//chart.Title.X = 1;
chart.Title.Font.Color = Color.Blue;
chart.Title.Font.Size = 10;
chart.Title.Font.IsBold = true;
chart.Title.Font.Name = “Arial”;
chart.Title.Font.Underline = FontUnderlineType.Single;
//chart.Title.IsAutomaticSize = false;
//chart.Title.AutoScaleFont = false;

chart.Title.X = 0;
chart.Title.Y = 0;
chart.Title.TextVerticalAlignment = TextAlignmentType.Left;
chart.Title.TextHorizontalAlignment = TextAlignmentType.Left;

chart.Legend.Font.Size = 7;
chart.Legend.Position = LegendPositionType.NotDocked;
chart.Legend.Y = 0;
chart.Legend.X = 3000;
chart.Legend.Area.ForegroundColor = Color.LightYellow;
chart.Legend.Shadow = true;

series1.XValues = “A1:A3”;

chart.CategoryAxis.TickLabels.RotationAngle = 45;
chart.CategoryAxis.TickLabels.Font.Size = 6;

chart.CategoryAxis.Title.Text = “”;
chart.SecondCategoryAxis.Title.Text = “”;
chart.SeriesAxis.Title.Text = “”;
chart.ValueAxis.Title.Text = “”;

wb.Save(“pre_merge_” + DateTime.Now.Ticks + “.xlsx”);

Workbook targetWorkbook = new Workbook();
Worksheet targetWorksheet = targetWorkbook.Worksheets[“targetTabName”];

targetWorkbook.Save(“good_formatting_” + DateTime.Now.Ticks + “.xls”);
targetWorkbook.Save(“bad_formatting_” + DateTime.Now.Ticks + “.xlsx”);


Thanks for your posting and using Aspose.Cells for .NET.

We have looked into your issue and was able to replicate it using your code with the latest verison:
for .NET v7.3.1.3

I have attached the output files for your reference.

We have logged this issue in our database. We will look into it and fix the issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-41047.

Hopefully this can be resolved quickly as it is a major issue for hundreds of users.

Thank you.


Yes, we hope so. Once we figure it out or have some update on it, we will update you here immediately.

Have a good time!

We have fixed this issue.

Please download and try this fix: Aspose.Cells for .NET v7.3.2.2 and let us know your feedback.


The issues you have found earlier (filed as CELLSNET-41047) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.