It seems you are experiencing issues with chart alignment and text display when printing from Aspose.Cells. Here are a few suggestions to address the problems you mentioned:
Chart Positioning: If the rectangles and text overlays are misaligned when printed, you may need to adjust the chart’s position and size programmatically. You can use the following code snippet to reposition and resize the chart:
Workbook workbook = new Workbook("path/to/your/file.xls");
Worksheet worksheet = workbook.getWorksheets().get(0);
Chart chart = worksheet.getCharts().get(0);
// Resize the chart
chart.getChartObject().setWidth(400);
chart.getChartObject().setHeight(300);
// Reposition the chart
chart.getChartObject().setX(250);
chart.getChartObject().setY(150);
// Save the modified workbook
workbook.save("path/to/save/modified_file.xls");
This code allows you to set the width, height, and position of the chart, which may help in aligning it correctly when printed.
Legend Text Orientation: For the issue with legend text being displayed diagonally in Excel but horizontally when printed, ensure that the text orientation settings for the legend are correctly configured. You may need to check the properties of the legend in your chart and adjust them accordingly.
If these adjustments do not resolve the issues, consider checking for any updates or patches for Aspose.Cells, as newer versions may contain fixes for known bugs related to chart rendering and printing.
If you continue to face challenges, please provide additional details or examples, and I would be happy to assist further.
Thanks for offered workaround. If we have only one chart we can use your advice, write a routine to recognize and fix layer offset.
Unfortunately there are more charts being processed and it is tricky for us to programmatically recognize which layer and of how many points is printed misaligned and needs correction.
@ottap
We can reproduce your mentioned issues and have opened the two issues:
CELLSNET-57980 Rectangles and red texts are more on top when printed by Aspose then in original.
CELLSNET-57981 Legend texts are displayed diagonally in Excel but printed horizontally in Aspose.
If there is any update , we will inform you soon.
Hi @ottap
We can see from your screenshot that you are using net8.
Could you please confirm your specific usage environment, whether it is Windows or Linux, and you are using Skiasharp or System.Drawing.Common for the graphics library.
Different environments and graphics libraries may cause differences, in order to better test and correct, we need to know these, thank you.
Please try the latest version of Aspose.Cells 25.3, I just tested it in 25.2 and 25.3, the results are as follows. This issue may have been resolved in daily optimization. Please let us know the result after you try it, thank you very much.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.