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
close icon

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.  
            <chart:ChartAxisLabelStyle LabelFormat="hh:mm:ss"></chart:ChartAxisLabelStyle>   
SFDateTimeAxis dateTimeAxis = new SFDateTimeAxis();   
dateTimeAxis.LabelStyle.LabelFormatter = new NSDateFormatter() {DateFormat="hh:mm:ss"};   
DateTimeAxis dateTimeAxis = new DateTimeAxis(); 
dateTimeAxis.LabelStyle.LabelFormat = "hh:mm:ss"; 
Please let us know, if you need further assistance on this.   
Parthiban S  

Live Chat Icon For mobile
Up arrow icon