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

Free Support Forum - aspose.com

CategoryAxis TickLabels cut off ("..." at the end) when chart is converted to image?

I have a chart with slanted CategoryAxis TickLabels (-45 degree rotation angle) that I’m converting to an image file with Aspose.Cells. A few of the labels were too long and Aspose cut off the end of these long labels by ending the label text with 3 periods “…”.

I’ve found out that I can get around this problem by increasing the chart height (chart.ChartObject.Height) but I was wondering if there is a chart property that I could set that would cause Aspose to automatically adjust the chart height so that the label text would not get cut off when converting a chart to an image file? Below is the C# code I’m using:

ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
imgOptions.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
worksheet = workbook.Worksheets[2];
Aspose.Cells.Charts.Chart chart = worksheet.Charts[0];
chart.ToImage(“test.png”, imgOptions);

Hi Mark,

Thanks for your posting and using Aspose.Cells.

Please provide us your source excel file containing your chart and which you are converting to image so that we could investigate this issue further.

Mostly, the output chart looks exactly same as input chart and you don’t need to do anything extra to get the correct image.