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

Set Legend FontSize

Hi,

i'm trying to size the sfchart legend font. I used the code given on:

https://help.syncfusion.com/xamarin/sfchart/legend?cs-save-lang=1&cs-lang=xaml

but i get the error saying:

 No property, bindable property, or event found for 'FontSize'

Seems like the Xamarin Forms Font Class only has readonly fontsize property.

So my question is, how do i set the legends font size?


2 Replies

SP Saravana Pandian Murugan Syncfusion Team July 27, 2017 04:35 PM UTC

Hi Simon, 
 
Thanks for using Syncfusion products. 
 
We would like to inform you that this is an issue with the framework when XAML compilation is enabled. We have also ensured this in Font property for Label and the same issue is reproduced. To overcome this issue, you can set the FontSize as per the below code. 
 
Code Example: 
 
 
<chart:SfChart.Legend> 
 
     <chart:ChartLegend> 
        
         <chart:ChartLegend.LabelStyle> 
 
             <chart:ChartLegendLabelStyle Font="30"/> 
 
        </chart:ChartLegend.LabelStyle> 
 
       </chart:ChartLegend> 
 
</chart:SfChart.Legend> 
 
 
We have also attached sample for your requirement which can be downloaded from the below location.  
 
 
Note: We will modify the code snippet of FontSize in our User Guide document in one business day (July 28, 2017). 
 
Please check the sample and let us know if you need further assistance on this. 
 
Regards, 
Saravana Pandian M. 



SP Saravana Pandian Murugan Syncfusion Team July 31, 2017 10:36 AM UTC

Hi Simon,

Sorry for the delay.

We have modified the code snippet of FontSize in our Xamarin.Forms User Guide document. Please find the below User Guide link of Legend.

UG Link: https://help.syncfusion.com/xamarin/sfchart/legend#customizing-labels  

Regards,
Saravana Pandian M.


Loader.
Up arrow icon