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

Provide date range for chart

have to provide date range for charts
how it possible
show monthly,yearly,weekly records with given  from date and to date

1 Reply

JA Jayavigneshwaran Syncfusion Team February 18, 2015 07:02 AM UTC

Hi Kalpa,

Thanks for using Syncfusion product.

We have analyzed this. Range to the date time axis can be set by specifying as like the below mentioned format.



          .PrimaryXAxis(xaxis=>xaxis.Range(ra=>ra.Min(new DateTime(2009,12,30))

          .Max(new DateTime(2010,12,1)).Interval(1))))


Since date time axis is of linear type, interval for this can be of days / months/ years / hours / seconds / minutes / milliseconds (i.e. any date time unit). This can be specified in sample by setting the below property.



          .PrimaryXAxis(xaxis=>xaxis .IntervalType(ChartIntervalType.Years))) 


The below shows a simple date time axis chart which takes interval as years

Sample code:




                                    .Range(ra=>ra.Min(new DateTime(2009,6,1) ).Max(new DateTime(2010,6,1)).Interval(1))



The below shows a date time axis chart in which interval in calculated based on months

We have also made a sample to illustrate this. Find it from the below location.

Kindly refer the below link for more details regarding this

Link: https://help.syncfusion.com/ug/js/documents/datetimeaxis.htm

Please let us know if you have any concern.



Live Chat Icon For mobile
Up arrow icon