We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Chart legent font size issue

When I set the legend font size using IChartShape.Legend.TextArea.Size, it is set in Excel, I can see it when I open font properties of my chart in Excel. The issue is that for underlying legend entries the font remains default so I still see the legend displayed with default font size n Excel. Only when I change some font properties in Excel and apply those changes, my font size is propagated to the entries. So I have to loop via all IChartShape.Legend.LegendEntries to set their TextArea.Size property. I think it's a bug because setting the Legend.TextArea.Size should set this font size for all entries in this legend as well.


3 Replies

GM Geetha M Syncfusion Team October 30, 2008 05:22 AM UTC

Hi Alexey,

Thank you for your interest in Syncfusion products.

I was not able to reproduce the issue. Please refer to the test sample in the below link:

http://websamples.syncfusion.com/samples/XlsIO.Web/6.4.0.14/F77383/main.htm

Could you please reproduce the problem in the above sample and send us so that it would help us to find the cause of the problem? Also please let us know the Essential Studio version you are currently using.

Regards,
Geetha



AD Administrator Syncfusion Team October 30, 2008 01:40 PM UTC

Well, the issue is still reproducable. YOur example really works, but I first converted your file to Excel 2007, then I removed the chart from it and modified your code to create the chart. The result - legend properties are no changed.

The new code:
ExcelEngine excelEngine = new ExcelEngine();
IApplication app = excelEngine.Excel;
IWorkbook workbook = app.Workbooks.Open(Server.MapPath(@"App_Data\TestChart.xlsx"), ExcelOpenType.Automatic);
IWorksheet sheet = workbook.Worksheets[0];

IChartShape chart = sheet.Charts.Add();
chart.DataRange = sheet.Range["A1:B6"];
chart.TopRow = 7;
chart.Legend.TextArea.Size = 12;
chart.Legend.TextArea.Italic = true;

workbook.SaveAs("Sample.xlsx", Response, ExcelDownloadType.PromptDialog);
workbook.Close();
excelEngine.Dispose();



GM Geetha M Syncfusion Team October 31, 2008 11:42 AM UTC

Hi Alexey,

Thank you for the modified code.

I was able to reproduce the issue. This has been forwarded to our developers for more analysis. Please follow up the incident #51040 regarding the issue and fix details.

Regards,
Geetha


Loader.
Live Chat Icon For mobile
Up arrow icon