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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize each label of the axis in different format?

In SfChart, you can format the axis labels using the LabelFormat property of the respective axis. This will format all the labels in an axis with the same format.

Suppose, if you want to format each label in an axis with different format, this can be done in LabelCreated event. This event will be fired once for each label of that axis. You can get the current label’s content using the LabelContent property in the event argument and format the label and assign the formatted content to the LabelContent property itself.

In the following code example, the first label of each month in the DateTimeAxis is formatted with month format and other labels in the same month are formatted with day format.

C#

 

XAML

 

 [C#]

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomAxisLabel1047363945.zip     

 

Output:

C:\Users\yuvaraj.palanisamy\Pictures\android7.png

Article ID: Published Date: Last Revised Date: Platform: Control:
5560 11/06/2015 03/05/2018 Xamarin.Forms SfChart
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon