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

Set the minimum and maximum date in the datetimeaxis in the code behind

In XAML, the following piece of code will help set the minimum and maximum value in the axis.

<syncfusion:DateTimeAxis LabelFormat="dd/MM/yyyy" Minimum="01/01/2016" Maximum="06/06/2016"/>

How do i do the same in the code behind?

Thanks in advance.

3 Replies

DA Devi Aruna Maharasi Murugan Syncfusion Team May 30, 2016 11:11 AM UTC

Hi Dharani, 
  
Thanks for contacting Syncfusion Support. 
  
We have converted the date time axis XAML code to C#. Please find the below code example. 
  
Code Example: 
[C#] 
   DateTimeAxis xAxis=new DateTimeAxis() 
    { 
        //Setting the properties for DateTime Axis 
        Minimum=new DateTime(2015,01,01), 
        Maximum=new DateTime(2015,05,01), 
        LabelFormat="dd/MM/yyyy" 
   }; 
   chart.PrimaryAxis=xAxis; 
  
  
Regards, 
Devi M 



DP Dharani Priyanka Suresh May 31, 2016 05:24 AM UTC

Thank you Devi.

This resolved the problem.




DA Devi Aruna Maharasi Murugan Syncfusion Team June 1, 2016 07:06 AM UTC

Hi Dharani,

Thanks for your updates.

We are glad to know that your requirement has been achieved.

Please contact us, if you need any further assistance.

Regards,
Devi M

Loader.
Live Chat Icon For mobile
Up arrow icon