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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Formatting labels on axes

Thread ID:





118215 Feb 12,2015 09:25 AM UTC Aug 18,2016 07:08 AM UTC Xamarin.Forms 7
Tags: SfChart
Steen Steiniche
Asked On February 12, 2015 09:25 AM UTC

How does one format labels on chart axes?
For example, if I have a series with dates on the primary axis (x axis) and want to format these labels to, say, "dd MMM", how do I do that?
I do not want to change the actual date values in the data used for the series. I want to change labels before rendering chart.

Magesh Kumar Krishnan [Syncfusion]
Replied On February 12, 2015 10:55 AM UTC

Hi Steen,

Thanks for using Syncfusion Products.

We can achieve your requirement by using LabelFormat property of ChartAxis as shown in the below code snippet.


[XAML] :


            <chart:ChartAxisLabelStyle LabelFormat = "dd MMM"></chart:ChartAxisLabelStyle>


[C#] :

DateTimeAxis dateTimeAxis = new DateTimeAxis();

dateTimeAxis.LabelStyle.LabelFormat = "dd MMM ";

Please let us know if you require further assistance on this.


Magesh Kumar K

Steen Steiniche
Replied On February 12, 2015 11:22 AM UTC

Hello Magesh Kumar K
Thanks for your reply. That works if I want to set an overall format rule.
I need more control than that, however. For instance, I might want to format only the first date of the month with "dd MMM" and all other dates in that month with just "dd". How is that achieved?
Thanks in advance

Magesh Kumar Krishnan [Syncfusion]
Replied On February 13, 2015 07:05 AM UTC

Hi Steen,

We are glad to let you know that we have achieved your requirement by using a workaround. In this sample, we have written custom renderer for each platform for formatting individual labels in axis. We will provide this support in control level in any of our upcoming volume release.

Please find the workaround sample from the following attachment.

Sample: http://www.syncfusion.com/downloads/support/directtrac/118215/CustomAxisLabelFormat-1084686580.zip

While customizing individual axis labels in custom renderer for iOS, we faced an error while deploying it to an iPhone device. We have also fixed that error. Please replace the below attached Syncfusion.SfChart.iOS.dll in your “../lib/1.3/ios-unified” and “../lib/1.3/ios“paths in order to run the application on iPhone device.

Dll: http://www.syncfusion.com/downloads/support/directtrac/118215/Xamarian.iOS_Assemblies-83160372.zip

Please let us know if you require further assistance on this.

Magesh Kumar K

Tomasz Wisniewski
Replied On February 24, 2015 07:56 PM UTC

Date and time take some space horizontally, so on Windows Phone I displayed label in two rows: time on top (with "t" formatter, eg. 9:15 PM) and and date on bottom (MonthDayPattern, eg. Jan 1). I used LabelTemplate and and StackPanel inside of it. Is it possible to do something similar in Xamarin.Forms? I tried to achieve this with the custom renderer that you provided, however if I give string with two lines it renders in one line anyway. If I give for example TextView as LabelContent, it displays only class name. Do you have any ideas?


Magesh Kumar Krishnan [Syncfusion]
Replied On February 25, 2015 01:18 PM UTC

Hi Thomasz,

We have created incident #135846 on behalf of you for this reported requirement. Our support engineer will assist you through incident under your Direct Trac account. So we request you to follow with the incident for further details.
Our Direct Trac support system can be accessed from the following link:

Please let us know if you require further assistance on this.

Magesh Kumar K

David Myers
Replied On August 17, 2016 04:39 AM UTC


Was a solution found to allow line breaks in axis labels? We'd also like to utilize this feature.

Yuvaraj Palanisamy [Syncfusion]
Replied On August 18, 2016 07:08 AM UTC

Hi David, 

We have logged this as a feature request in our database. We will implement this feature in upcoming volume 2 service pack 2 release and it is estimated to be rolled in the end of August, 2016.  


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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