Hi Costanza,
Sorry for the delay.
If we set the default FontFamily which are available in mobile phones, it will work by default. If we set custom FontFamily, it wouldn`t work. In your sample, you have set the “Arial” font which is a custom font. So, we need to follow the below platform specific steps to set custom FontFamily. For Example,
In Xamarin.Forms Android platform:
1. Download the custom font (arial.ttf) file.
2. Add that font file to the Assets folder in the application project.
3. Set Build Action = AndroidAsset.
4. Then, use the below code snippet in your application.
Code Snippet:
<chart:CategoryAxis.LabelStyle>
<chart:ChartAxisLabelStyle>
<chart:ChartAxisLabelStyle.Font>
<Font FontSize="20" FontFamily="arial.ttf#arial "/>
</chart:ChartAxisLabelStyle.Font>
</chart:ChartAxisLabelStyle>
</chart:CategoryAxis.LabelStyle>
|
In Xamarin.Forms iOS and UWP platforms, the above mentioned four steps will change slightly.
Please refer the below link for more details about how to set custom font.
We have attached a sample for your reference which can be downloaded from the following location.
Note: This sample will work only in UWP platform. We are facing issues in Android and iOS platform. We will update you with more details in one business day (May 31, 2017).
Regards,
Saravana Pandian M.