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:

Created:

Updated:

Platform:

Replies:

118258 Feb 17,2015 10:39 AM UTC Feb 18,2015 07:02 AM UTC ASP.NET MVC 1
loading
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.

[CSHTML]

     @(Html.EJ().Chart("container")

          .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.

[CSHTML]

      @(Html.EJ().Chart("container")

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

  

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

Sample code:

   @(Html.EJ().Chart("container")

          .PrimaryXAxis(xaxis=>xaxis.ValueType(AxisValueType.Datetime)

                                    .LabelFormat("MMM-yyyy")

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

                                    .IntervalType(ChartIntervalType.Years)

                                    .EdgeLabelPlacement(EdgeLabelPlacement.Shift)))

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.
MvcApplication47.zip

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.

Thanks,

Jayavigneshwaran

CONFIRMATION

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.

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

;