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

Free Support Forum - aspose.com

Category Axis RotationAngle Issue

Hi,


I am working on aspose charts since many days but getting a weird issue related to charts. I have to set the orientation of category axis in a line chart, but when I am doing the same with the following line of code, category axis labels getting duplicated like the following picture.

This line of code is causing the issue.
chart.CategoryAxis.TickLabels.RotationAngle = 45;

Please refer the attached image for more details. the only difference between the code for both of them is the line mentioned above. We have he angle to be 45 but I m clueless what’s causing the duplication of values.

Please note this is happening for some cases only. Please help for the fix…

Hi,

Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells
for .NET v8.2.0.3
it should fix your issue.

We have tested this issue with the following code using the source Excel file attached. As you can see in the output chart image, category axis labels are not duplicating. I have also attached the output chart image for your reference.

In case, your problem still occurs with the latest version, then please provide us your sample console application project (code) replicating this issue with the latest version. Please also provide us any source Excel file used in your code.

We will further investigate this issue at our end and in case, there is some bug, we will fix it in our next versions.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\sample.xlsx”;


Workbook workbook = new Workbook(filePath);


Worksheet worksheet = workbook.Worksheets[0];


Chart chart = worksheet.Charts[0];

chart.CategoryAxis.TickLabels.RotationAngle = 45;


chart.ToImage(filePath + “.out.png”, ImageFormat.Png);

Hi Shakeel,


1. We have tried using the latest DLLs but the issue still persists. Actually even we are getting the issue in very few cases only and so not sure what is going wrong.
2. Commenting the rotation angle only is helping us out but then not sure how to get the desired orientation.
3 It wont be possible to share the application code as its a part of a big app where daa coming from many places. Still for your convenience, I am sharing the data in this scenario in an excel file and the C# code in a text file which we are using for this.

Thanks

Hi,

Thanks for your posting and using Aspose.Cells.

I am not able to run your code because it is giving me compile time errors. Kindly provide some runnable sample code replicating this issue, because it will be helpful for us investigating this issue and we will be able to fix it precisely.

Hi,


I think I have to prepare the application in that case, if nothing works out. One alternative for temporary basis can be rotating the category axis by some other method/property in C# code. So can you suggest some alternative of the following line of code?

chart.CategoryAxis.TickLabels.RotationAngle = 45;

Might be this can work out for us…
Thanks in advance for your help…!!!

Hi,

Thanks for your posting and using Aspose.Cells.

We will recommend you to give a try to latest version: Aspose.Cells
for .NET v8.2.1.4
because such issues should be resolved inside it.

We are afraid, there is no alternative to your suggested line. If your problem still occurs, then kindly provide some sample project replicating this issue with the given latest version, so that we could investigate and fix it.

Thanks for your cooperation.

Ok, these seems the latest DLL files.

But we need to get the latest license also in that case.

I will check this and let you know shortly. Thanks for your reply.


I have tried with the latest DLLs you mentioned and the License files also, but still no luck. The data points in the chart are still repeating…


I will shortly get to you with running code which causes this issue.

Hi,

Thanks for your posting and using Aspose.Cells.

Definitely, your sample console application replicating this issue will be helpful for us to investigate and fix the problem.

Thanks for your cooperation.

Hi,

We will take this up later.
But as a quick fix, can we set the height, width of category axis tick labels?

Please check the attached image and let us know.

Hi,

Thanks for your posting and using Aspose.Cells.

I tried to create chart like yours in MS-Excel and I found that we cannot select individual tick labels of category axis. I therefore, could not create a chart where some of the category axis tick labels were wrapped and some were straight.

Could you please check the sample Excel file attached by me and make some of the category axis tick labels wrapped and some of them in a single line using MS-Excel manually and reattach it?

Also, let me know the steps you took to create/modify this chart manually using MS-Excel. It will help me investigate this feature and find out if it is supported or not. In case, it is a New Feature, we will log it in our database so that it could be implemented in our future versions.

I tried it both on MS-Excel 2010 and MS-Excel 2013 but could not create a chart like yours.