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

Free Support Forum - aspose.com

Chart CategoryAxis slanted TickLabel text cut off when converted to image

I have a chart on a worksheet that I am trying to convert to a png image file. The chart’s CategoryAxis TickLabel text is slanted with a lower left to upper right orientation so that the TickLabel text extends beyone the ValueAxis TickLabel text on the left side of the chart. When this chart is converted to an image file, some of the CategoryAxis TickLabel text is getting cut off on the left side of the chart.

Is there any way to increase the charts left margin so this text won’t get cut off?

Hi Mark,

I suspect that the problem is in your current revision of the API as everything inside the chart area should render without making any modifications for most of the cases. We can help you better if you can share your code for rendering along with the spreadsheet containing the problematic chart. However, before you move forward to provide the above requested, please give a try to the latest version of Aspose.Cells for .NET and let us know of your feedback.

Ok, I tried Aspose.Cells for .NET and got the same result (text chopped off). I’ve attached the workbook giving me the problem and the image file Aspose created. Below is the part of my C# code that creates the image file:

Workbook workbook = new Workbook(kennaExcelFileDirectory + “\” + fileName);
worksheet = workbook.Worksheets[2];
imageFileFormat = System.Drawing.Imaging.ImageFormat.Png;
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = imageFileFormat;
imgOptions.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
Aspose.Cells.Charts.Chart chart = worksheet.Charts[0];
imageFilename = “Kenna_Vuln_Exposure_Auth_Failed_Windows.png”;
chart.ToImage(imageFilename, imgOptions);

Hi Mark,

Thank you for sharing the sample spreadsheet.

We have evaluated the presented scenario on our side, and we are able to notice the said issue therefore we have opened a case as CELLSNET-44010. Our product team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

I tried hardcoding the rotation angle to 45 degrees and it produced the image with no chopped off text:

chart.CategoryAxis.TickLabels.RotationAngle = 45;

Hi Mark,

Thank you for suggesting the workaround. This will be helpful for the users who are facing the similar issue, however, the issue should not arise even without setting the rotation angle therefore we appreciate your patience while we are investigating the problem cause. We will keep you posted with updates in this regard.
Hi again,

This is to update you that we have fixed the problem logged earlier as CELLSNET-44010. We will shortly provide the fix here after ensuring the quality of the build and incorporating other enhancements.


Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells
for .NET v8.6.1.6
and let us know your feedback.

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

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.