- Home
- Forum
- Xamarin.Forms
- LabelFormat of SfChart Axis is not working with "### ### ### ##0.000".
LabelFormat of SfChart Axis is not working with "### ### ### ##0.000".
5 Replies
MK
Muneesh Kumar G
Syncfusion Team
September 30, 2019 06:53 AM UTC
Hi Nguyen,
Thanks for using Syncfusion products.
We have analyzed your requirement and would like to explain you that in source level, we have used the DecimalFormat method to format the axis labels. So, given format of yours is not a correct one. Please refer the below link for supportable labels formats in android.
Reference link –
Code snippet [C#]:
|
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis >
<chart:NumericalAxis.LabelStyle>
<chart:ChartAxisLabelStyle LabelFormat="###,###.###" />
</chart:NumericalAxis.LabelStyle>
</chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
|
Sample – https://www.syncfusion.com/downloads/support/directtrac/147952/ze/147952-sample1374691189.zip
Screenshot:
Or please provide the details on how you want to format the labels. Please get back to us for further assistance.
Thanks,
Muneesh Kumar G.
NK
Nguyen Khoa Lu
September 30, 2019 09:37 AM UTC
Thanks for answer, now I want format the number: 123456789 to 123.456.789,00 How to?
MK
Muneesh Kumar G
Syncfusion Team
October 3, 2019 08:58 AM UTC
Hi Nguyen,
We have analysed your requirement and you can achieve this requirement by modifying the LabelContent in the LabelCreated event of ChartAxis. Please refer the below code.
Code snippet[XAML]:
|
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis LabelCreated="NumericalAxis_LabelCreated">
</chart:NumericalAxis>
</chart:SfChart.SecondaryAxis> |
Code snippet[C#]:
|
private void NumericalAxis_LabelCreated(object sender, ChartAxisLabelEventArgs e)
{
double value = Convert.ToDouble(e.LabelContent);
e.LabelContent = value.ToString("C", new CultureInfo("vi-VN"));
} |
Sample – https://www.syncfusion.com/downloads/support/directtrac/147952/ze/147952-sample1825945201.zip
Screenshot:
Please let us know if you have any other queries.
Thanks,
Muneesh Kumar G.
NK
Nguyen Khoa Lu
October 5, 2019 01:37 AM UTC
Thanks for your answer, I did it 3 day ago. Thanks again!
HM
Hemalatha Marikumar
Syncfusion Team
October 7, 2019 06:23 AM UTC
Hi Nguyen,
Thanks for your update.
Please let us know if you need any further assistance.
Regards,
Hemalatha M.
Hemalatha M.
SIGN IN To post a reply.
- 5 Replies
- 3 Participants
-
NK Nguyen Khoa Lu
- Sep 29, 2019 05:06 AM UTC
- Oct 7, 2019 06:23 AM UTC