Chart control has the ability to have date-time values. In addition to this, the axis range and interval can also be set for date-time values. Refer to the attached sample and the following code snippets for using this feature.
Date-time range can be set using the Axis.DateTimeRange property.
Chart1.Areas.PrimaryAxis.IsAutoSetRange = false;
Chart1.Areas.PrimaryAxis.DateTimeRange = new DateTimeRange(new DateTime(2009, 2, 1, 0, 0, 0), new DateTime(2009, 2, 15, 0, 0, 0));
Date-time interval can be set using the Axis.DateTimeInterval property.
Chart1.Areas.PrimaryAxis.DateTimeInterval = new TimeSpan(2, 0, 0, 0);
Custom ranges set will be effective only when the Axis.IsAutoSetRange property is set to false as shown in the above codes.
This page will automatically be redirected to the sign-in page in 10 seconds.