Winform Chart - How to change legend´s font size

hello, I've been analyzing, debugging the data and reviewing forums and I can't find how to change the font size for the legends.

I attach an example, even the attribute does not appear if I allow the user to make changes, there is no option to change the font size.

I appreciate the help you can give me


Attachment: WinformChartFontSize_53c9b023.zip

6 Replies 1 reply marked as answer

GM Gayathri Manickam Syncfusion Team January 31, 2022 03:14 PM UTC

Hi Devoto, 
 
You can change the font size of the legend with the help of Legend.Font property in chartControl. Please refer the following code snippet. 
 
this.chartControl1.Legend.Font = new Font(FontFamily.GenericSansSerif,15); 
 
For more information, please refer below UG. 
 
Regards,  
Gayathri M 



PD Pablo Devoto February 8, 2022 07:59 PM UTC

Hello, thanks for the answer, it confirms that what I was doing before generating the query was correct.

There must be some other property that prevents increasing the font size, some kind of automatic resize.

I want to increase the font size of these legends



Except for the first line of code, add the rest to validate if it correctly changes other properties of the object.


And if I change the background color it works correctly, for example to RED


The same with showing or not the border and other properties, but what I can't get to increase is the font size.



The value of the property changed correctly as you can see in the Visual Studio WATCH image.

I put an exaggerated value of 300 but it doesn't work with 25, 30, 40, 50 as font size either.


Could there be some other property that makes it not apply the font size directly?



YP Yuvaraj Palanisamy Syncfusion Team February 9, 2022 01:58 PM UTC

 
We have checked the reported problem “Legend font size is not updated properly” and we are not able to reproduce this at our end. Also, we have attached the testbed sample for your reference. Please find the sample from the below link. 
 
 
Output: [FontSize: 12] 
 
 
FontSize: 15 
 
 
If still you are facing the problem, please revert us with the modified sample with issue reproduced sate which will be helpful to provide the better solution at the earliest.  
 
Regards, 
Yuvaraj. 



PD Pablo Devoto February 10, 2022 01:14 PM UTC

hi, the example send by you works very well.



In my case increase the size of the "TEXT" attribute but not the series's labels.
I'm going to check my code looking for the root cause



Thanks for your help!!!



PD Pablo Devoto February 10, 2022 04:33 PM UTC

hi again, congrats to me!!, :)
Solved adding this code line




Marked as answer

YP Yuvaraj Palanisamy Syncfusion Team February 11, 2022 10:24 AM UTC

Hi Devoto,  
  
Thanks for your update.   
  
We are glad to hear that you have found the solution. Please let us know if you need any further assistance on this. 
 
Regards, 
Yuvaraj. 


Loader.
Up arrow icon