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. Image for the cookie policy date

SFDateTimeAxis Change Label Format

The label on SFDateTimeAxis is only displaying the dates, but my data only covers two hours in timespan. How can I change the label to display times (e.g. hh:mm:ss)?

1 Reply

PS Parthiban Sundaram Syncfusion Team September 20, 2017 10:56 AM UTC

Hi Zhen,   
   
Thanks for using Syncfusion products.  
  
You can change the format of the date time axis labels using following code snippets.  
   
Xamarin.Forms:  
   
   
     <chart:DateTimeAxis>   
   
        <chart:DateTimeAxis.LabelStyle>   
   
            <chart:ChartAxisLabelStyle LabelFormat="hh:mm:ss"></chart:ChartAxisLabelStyle>   
   
        </chart:DateTimeAxis.LabelStyle>   
   
     </chart:DateTimeAxis>   
   
  
Xamarin.iOS:   
    
   
SFDateTimeAxis dateTimeAxis = new SFDateTimeAxis();   
    
dateTimeAxis.LabelStyle.LabelFormatter = new NSDateFormatter() {DateFormat="hh:mm:ss"};   
  
   
Xamarin.Android:   
 
   
DateTimeAxis dateTimeAxis = new DateTimeAxis(); 
 
dateTimeAxis.LabelStyle.LabelFormat = "hh:mm:ss"; 
  
   
Please let us know, if you need further assistance on this.   
   
Regards,   
Parthiban S  


Loader.
Up arrow icon