Problem with Legend in the Excel Chart: The Legend font size changes (gets smaller)

I have an Excel file with Chart Area and Legend in it. The original Legend font can be any type and any size. Let’s say the font size is 10.5 before running the code.

After running the following simple C# code, the Legend font size changes to 9.7:

Workbook wb = new Workbook();
string fileName = "Test.xls";
wb.Open(fileName);
wb.Save(fileName);
wb = null;

I am using Aspose.Cells.dll of version 5.3.1.

Hi,

Kindly post your template file here, we will check your issue soon.

Thank you.

I am attaching the original file.

Hi,

Please try the attached latest version v5.2.0.1. I have tested using your code and template (input)file, it works fine, the legend font is “Calibri, 7.5”, it remains the same in the output file too.


Thank you.

Hi Amjad,

Thank you for the new dll. It works in the same fashion. Not correctly.

The font “Calibri, 7.5” is the minimum one that could be. Before saving the font was 8.1.

Please open .xls file and manually set font for Legend as 11. Once you run an application (re-saving the file) you will have 10.1.

Thanks you.

Hi,

Well, it can be due to the behavior of different MS Excel versions. I set the font of legend to 11 for your template file “Legend.xls” by opening the file into MS Excel manually. When I open the generated file into Ms Excel 2007, the legend font is 10.1. But, when I open the generated file into MS Excel 2003, the font remains 11 for the legend box.


We will investigate your issue (logged as:
CELLSNET-22027) whether we can do something for it or it is routine of Ms Excel versions.

Thank you.

Hi,

Well, we confirmed that it is MS Excel 2007 behavior and not an issue with Aspose.Cells product.

I open the legend.xls in MS Excel 2003, change the font size, save the file in MS Excel 2003. Now, open the saved file in MS Excel 2007, i got 10.1 too. So doing steps in manual way also gives the same results.

Thank you.