Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145277 | Jun 14,2019 08:47 PM UTC | Jun 18,2019 05:33 AM UTC | Xamarin.Forms | 3 |
![]() |
Tags: SfChart |
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis Minimum="1000" Maximum="1000000" LabelCreated="NumericalAxis_LabelCreated">
</chart:NumericalAxis>
</chart:SfChart.SecondaryAxis> |
private void NumericalAxis_LabelCreated(object sender, ChartAxisLabelEventArgs e)
{
var position = e.Position;
var label = position.ToString("#,#", CultureInfo.InvariantCulture);
if (position >= 1000 && position < 1000000)
{
label = position.ToString("#,##0,K", CultureInfo.InvariantCulture);
}
else if (position >= 1000000 && position < 1000000000)
{
label = position.ToString("#,##0,,M", CultureInfo.InvariantCulture);
}
else if (position >= 1000000000)
{
label = position.ToString("#,##0,,,B", CultureInfo.InvariantCulture);
}
e.LabelContent = label;
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.