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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Provide date range for chart

Thread ID:





118258 Feb 17,2015 10:39 AM UTC Feb 18,2015 07:02 AM UTC ASP.NET MVC 1
Tags: Chart
kalpa serashiya
Asked On February 17, 2015 10:39 AM UTC

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

Jayavigneshwaran [Syncfusion]
Replied On 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: http://help.syncfusion.com/ug/js/documents/datetimeaxis.htm

Please let us know if you have any concern.




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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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