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

date Format DateTimeAxis

Thread ID:

Created:

Updated:

Platform:

Replies:

131901 Aug 2,2017 10:58 AM UTC Aug 3,2017 10:53 PM UTC Xamarin.Forms 3
loading
Tags: SfChart
David Perera
Asked On August 2, 2017 10:58 AM UTC

I cannot see a way to format the date in the DateTimeAxis.

Something like what we have in the SfDateTimeRangeNavigator e.g. SfDateTimeRangeNavigator.TooltipFormat = "dd/MM/yyyy";

Where is it?

Thanks!

Saravana Pandian Murugan [Syncfusion]
Replied On August 3, 2017 05:21 AM UTC

Hi David, 
  
Thanks for using Syncfusion products. 
  
You can achieve this requirement by using LabelFormat property of ChartAxisLabelStyle. Please find the below code snippet below. 
Code Example:  
  
[XAML]: 
  
  
<chart:SfChart.PrimaryAxis> 
  
    <chart:DateTimeAxis> 
  
        <chart:DateTimeAxis.LabelStyle> 
  
             <chart:ChartAxisLabelStyle LabelFormat ="dd/MMM"/>  
  
        </chart:DateTimeAxis.LabelStyle> 
  
    </chart:DateTimeAxis> 
  
</chart:SfChart.PrimaryAxis> 
  
  
[C#]: 
  
 
DateTimeAxis dateTimeAxis = new DateTimeAxis(); 
  
dateTimeAxis.LabelStyle.LabelFormat = "dd/MMM"; 
  
chart.PrimaryAxis = dateTimeAxis; 
  
  
We have prepared sample as per your requirement which can be downloaded from the following location. 
  
  
Please check the attached sample and let us know if you need further assistance on this. 
  
Regards, 
Saravana Pandian M. 


David Perera
Replied On August 3, 2017 07:35 AM UTC

That works perfect. Thanks!


Saravana Pandian Murugan [Syncfusion]
Replied On August 3, 2017 10:53 PM UTC

Hi David,

Thanks for the update. We are glad to know that the given solution worked. Please get back to us if you need further assistance.

Regards,
Saravana Pandian M.


CONFIRMATION

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.

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

;